Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
chore(release): 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Nov 25, 2019
1 parent 98a6c1d commit 2a18cba
Show file tree
Hide file tree
Showing 6 changed files with 429 additions and 389 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ All notable changes to this project will be documented in this file. See [standa
### BREAKING CHANGES

* minimum required nodejs version is `10.13.0`
* switch to ES modules by default (option `esModules` now is `true` by default)
* rename the `esModules` option to `esModule`
* switch to ES modules by default (the option `esModule` is `true` by default)



Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,15 @@ module.exports = {

> ℹ️ If `[0]` is used, it will be replaced by the entire tested string, whereas `[1]` will contain the first capturing parenthesis of your regex and so on...
### `esModules`
### `esModule`

Type: `Boolean`
Default: `false`

By default, `file-loader` generates JS modules that use the CommonJS syntax. However, there are some cases in which using ES2015 modules is beneficial, like in the case of [module concatenation](https://webpack.js.org/plugins/module-concatenation-plugin/) and [tree shaking](https://webpack.js.org/guides/tree-shaking/).
By default, `file-loader` generates JS modules that use the ES modules syntax.
There are some cases in which using ES modules is beneficial, like in the case of [module concatenation](https://webpack.js.org/plugins/module-concatenation-plugin/) and [tree shaking](https://webpack.js.org/guides/tree-shaking/).

You can enable a CommonJS module using:

**webpack.config.js**

Expand All @@ -394,7 +397,7 @@ module.exports = {
{
loader: 'file-loader',
options: {
esModules: true,
esModule: false,
},
},
],
Expand Down
Loading

0 comments on commit 2a18cba

Please sign in to comment.