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
alexander-akait committed Nov 25, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 98a6c1d commit 2a18cba
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
@@ -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)



9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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**

@@ -394,7 +397,7 @@ module.exports = {
{
loader: 'file-loader',
options: {
esModules: true,
esModule: false,
},
},
],
788 changes: 412 additions & 376 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -41,19 +41,19 @@
"schema-utils": "^2.5.0"
},
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/cli": "^7.7.4",
"@babel/core": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@webpack-contrib/defaults": "^6.0.2",
"@webpack-contrib/defaults": "^6.1.0",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^24.9.0",
"commitlint-azure-pipelines-cli": "^1.0.2",
"cross-env": "^6.0.3",
"del": "^5.1.0",
"del-cli": "^3.0.0",
"eslint": "^6.6.0",
"eslint": "^6.7.1",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-import": "^2.18.2",
"husky": "^3.1.0",
2 changes: 1 addition & 1 deletion src/options.json
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@
}
]
},
"esModules": {
"esModule": {
"type": "boolean"
}
},
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import {
readAsset,
} from './helpers';

describe('"esModules" option', () => {
describe('"esModule" option', () => {
it('should work without value', async () => {
const compiler = getCompiler('simple.js');
const stats = await compile(compiler);
@@ -22,7 +22,7 @@ describe('"esModules" option', () => {

it('should work with "Boolean" value equal "true"', async () => {
const compiler = getCompiler('simple.js', {
esModules: true,
esModule: true,
});
const stats = await compile(compiler);

@@ -37,7 +37,7 @@ describe('"esModules" option', () => {

it('should work with "Boolean" value equal "false"', async () => {
const compiler = getCompiler('simple.js', {
esModules: false,
esModule: false,
});
const stats = await compile(compiler);

0 comments on commit 2a18cba

Please sign in to comment.