Skip to content

Commit

Permalink
chore(release): 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jun 17, 2020
1 parent 574b5f6 commit ebfc6ad
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 10 deletions.
31 changes: 30 additions & 1 deletion CHANGELOG.md
@@ -1,7 +1,36 @@
# Change Log
# Changelog

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.

## [1.0.0](https://github.com/webpack-contrib/imports-loader/compare/v0.8.0...v1.0.0) (2020-06-17)


### ⚠ BREAKING CHANGES

* minimum supported Node.js version is `10.13`
* minimum supported `webpack` version is `4`
* `inline` syntax was changed, please [read](https://github.com/webpack-contrib/imports-loader#inline)
* list of imported modules moved to the `imports` option, please [read](https://github.com/webpack-contrib/imports-loader#imports)
* wrapper moved to the `wrapper` option, please [read](https://github.com/webpack-contrib/imports-loader#wrapper)
* custom variables moved to the `additionalCode` option, please [read](https://github.com/webpack-contrib/imports-loader#additionalcode)
* generates ES module default import by default (`import Foo from 'foo';`)

### Features

* validate options
* support webpack 5
* implemented the `type` option (imports can be CommonsJS or ES module format)
* implemented the ability to generate multiple import in CommonJS or ES module format
* improved support of `inline` usage
* allowed to adding arguments for wrapper
* allowed to inject any custom code

### Bug Fixes

* do not crash on invalid inline syntax
* respect `'use strict';`


<a name="0.8.0"></a>
# [0.8.0](https://github.com/webpack-contrib/imports-loader/compare/v0.7.1...v0.8.0) (2018-02-20)

Expand Down
28 changes: 21 additions & 7 deletions README.md
Expand Up @@ -65,6 +65,15 @@ import myLib from 'imports-loader?imports[]=default%20jquery%20$&imports[]=angul
// import angular from "angular";
```

```js
import myLib from 'imports-loader?imports[]=named%20library%20myMethod&imports[]=angular!./example.js';
// `%20` is space in a query string, equivalently `default jquery $` and `angular`
// Adds the following code to the beginning of example.js:
//
// import { myMethod } from "library";
// import angular from "angular";
```

```js
const myLib = require(`imports-loader?type=commonjs&imports[]=single%20jquery%20$&imports[]=angular!./example.js`);
// `%20` is space in a query string, equivalently `single jquery $` and `angular`
Expand All @@ -75,14 +84,11 @@ const myLib = require(`imports-loader?type=commonjs&imports[]=single%20jquery%20
```

```js
import(
`imports-loader?wrapper=window&imports[]=default%20jquery%20$&imports[]=angular!./example.js`
);
const myLib = require(`imports-loader?type=commonjs&imports=single%20myLib%20myMethod&&wrapper=window&!./example.js`);
// `%20` is space in a query string, equivalently `single jquery $` and `angular`
// Adds the following code to the example.js:
//
// import $ from "jquery";
// import angular from "angular";
// const myMethod = require('myLib');
//
// (function () {
// ...
Expand Down Expand Up @@ -461,6 +467,8 @@ Closes the module code in a function with a given `thisArg` and `args` (`(functi
#### `Boolean`

**webpack.config.js**

```js
module.exports = {
module: {
Expand Down Expand Up @@ -499,6 +507,8 @@ import $ from 'jquery';

#### `String`

**webpack.config.js**

```js
module.exports = {
module: {
Expand Down Expand Up @@ -537,6 +547,8 @@ import $ from 'jquery';

#### `Object`

**webpack.config.js**

```js
module.exports = {
module: {
Expand Down Expand Up @@ -583,6 +595,8 @@ Default: `undefined`

Adds custom code.

**webpack.config.js**

```js
module.exports = {
module: {
Expand All @@ -597,7 +611,7 @@ module.exports = {
moduleName: 'jquery',
name: '$',
},
additionalCode: 'var define = false;',
additionalCode: 'var myVariable = false;',
},
},
],
Expand All @@ -612,7 +626,7 @@ Generate output:
```js
import $ from 'jquery';

var define = false;
var myVariable = false;

// ...
// Code
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "imports-loader",
"version": "0.8.0",
"version": "1.0.0",
"description": "imports loader module for webpack",
"license": "MIT",
"repository": "webpack-contrib/imports-loader",
Expand Down

0 comments on commit ebfc6ad

Please sign in to comment.