Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
refactor: esModule option is true by default (#1111)
BREAKING CHANGE: the `esModule` option is `true` by default
  • Loading branch information
cap-Bernardito committed Jul 17, 2020
1 parent 7cca035 commit 908ecee
Show file tree
Hide file tree
Showing 21 changed files with 1,738 additions and 1,658 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -1064,12 +1064,12 @@ module.exports = {
### `esModule`

Type: `Boolean`
Default: `false`
Default: `true`

By default, `css-loader` generates JS modules that use the CommonJS modules syntax.
By default, `css-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 ES module syntax using:
You can enable a CommonJS modules syntax using:

**webpack.config.js**

Expand All @@ -1081,7 +1081,7 @@ module.exports = {
test: /\.css$/i,
loader: 'css-loader',
options: {
esModule: true,
esModule: false,
},
},
],
Expand Down

0 comments on commit 908ecee

Please sign in to comment.