Skip to content

Commit ebfc6ad

Browse files
committedJun 17, 2020
chore(release): 1.0.0
1 parent 574b5f6 commit ebfc6ad

File tree

4 files changed

+53
-10
lines changed

4 files changed

+53
-10
lines changed
 

‎CHANGELOG.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
1-
# Change Log
1+
# Changelog
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [1.0.0](https://github.com/webpack-contrib/imports-loader/compare/v0.8.0...v1.0.0) (2020-06-17)
6+
7+
8+
### ⚠ BREAKING CHANGES
9+
10+
* minimum supported Node.js version is `10.13`
11+
* minimum supported `webpack` version is `4`
12+
* `inline` syntax was changed, please [read](https://github.com/webpack-contrib/imports-loader#inline)
13+
* list of imported modules moved to the `imports` option, please [read](https://github.com/webpack-contrib/imports-loader#imports)
14+
* wrapper moved to the `wrapper` option, please [read](https://github.com/webpack-contrib/imports-loader#wrapper)
15+
* custom variables moved to the `additionalCode` option, please [read](https://github.com/webpack-contrib/imports-loader#additionalcode)
16+
* generates ES module default import by default (`import Foo from 'foo';`)
17+
18+
### Features
19+
20+
* validate options
21+
* support webpack 5
22+
* implemented the `type` option (imports can be CommonsJS or ES module format)
23+
* implemented the ability to generate multiple import in CommonJS or ES module format
24+
* improved support of `inline` usage
25+
* allowed to adding arguments for wrapper
26+
* allowed to inject any custom code
27+
28+
### Bug Fixes
29+
30+
* do not crash on invalid inline syntax
31+
* respect `'use strict';`
32+
33+
534
<a name="0.8.0"></a>
635
# [0.8.0](https://github.com/webpack-contrib/imports-loader/compare/v0.7.1...v0.8.0) (2018-02-20)
736

‎README.md

+21-7
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ import myLib from 'imports-loader?imports[]=default%20jquery%20$&imports[]=angul
6565
// import angular from "angular";
6666
```
6767

68+
```js
69+
import myLib from 'imports-loader?imports[]=named%20library%20myMethod&imports[]=angular!./example.js';
70+
// `%20` is space in a query string, equivalently `default jquery $` and `angular`
71+
// Adds the following code to the beginning of example.js:
72+
//
73+
// import { myMethod } from "library";
74+
// import angular from "angular";
75+
```
76+
6877
```js
6978
const myLib = require(`imports-loader?type=commonjs&imports[]=single%20jquery%20$&imports[]=angular!./example.js`);
7079
// `%20` is space in a query string, equivalently `single jquery $` and `angular`
@@ -75,14 +84,11 @@ const myLib = require(`imports-loader?type=commonjs&imports[]=single%20jquery%20
7584
```
7685

7786
```js
78-
import(
79-
`imports-loader?wrapper=window&imports[]=default%20jquery%20$&imports[]=angular!./example.js`
80-
);
87+
const myLib = require(`imports-loader?type=commonjs&imports=single%20myLib%20myMethod&&wrapper=window&!./example.js`);
8188
// `%20` is space in a query string, equivalently `single jquery $` and `angular`
8289
// Adds the following code to the example.js:
8390
//
84-
// import $ from "jquery";
85-
// import angular from "angular";
91+
// const myMethod = require('myLib');
8692
//
8793
// (function () {
8894
// ...
@@ -461,6 +467,8 @@ Closes the module code in a function with a given `thisArg` and `args` (`(functi
461467
462468
#### `Boolean`
463469

470+
**webpack.config.js**
471+
464472
```js
465473
module.exports = {
466474
module: {
@@ -499,6 +507,8 @@ import $ from 'jquery';
499507

500508
#### `String`
501509

510+
**webpack.config.js**
511+
502512
```js
503513
module.exports = {
504514
module: {
@@ -537,6 +547,8 @@ import $ from 'jquery';
537547

538548
#### `Object`
539549

550+
**webpack.config.js**
551+
540552
```js
541553
module.exports = {
542554
module: {
@@ -583,6 +595,8 @@ Default: `undefined`
583595

584596
Adds custom code.
585597

598+
**webpack.config.js**
599+
586600
```js
587601
module.exports = {
588602
module: {
@@ -597,7 +611,7 @@ module.exports = {
597611
moduleName: 'jquery',
598612
name: '$',
599613
},
600-
additionalCode: 'var define = false;',
614+
additionalCode: 'var myVariable = false;',
601615
},
602616
},
603617
],
@@ -612,7 +626,7 @@ Generate output:
612626
```js
613627
import $ from 'jquery';
614628

615-
var define = false;
629+
var myVariable = false;
616630

617631
// ...
618632
// Code

‎package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "imports-loader",
3-
"version": "0.8.0",
3+
"version": "1.0.0",
44
"description": "imports loader module for webpack",
55
"license": "MIT",
66
"repository": "webpack-contrib/imports-loader",

0 commit comments

Comments
 (0)
Please sign in to comment.