Skip to content

Commit 884cbfe

Browse files
docs: fix ambiguous docs (#605)
1 parent 7335077 commit 884cbfe

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ Works like [`output.filename`](https://webpack.js.org/configuration/output/#outp
9595
Type: `String|Function`
9696
Default: `based on filename`
9797

98+
> i Specifying `chunkFilename` as a `function` is only available in webpack@5
99+
98100
This option determines the name of non-entry chunk files.
99101

100102
Works like [`output.chunkFilename`](https://webpack.js.org/configuration/output/#outputchunkfilename)
@@ -104,7 +106,8 @@ Works like [`output.chunkFilename`](https://webpack.js.org/configuration/output/
104106
Type: `Boolean`
105107
Default: `false`
106108

107-
Remove Order Warnings
109+
Remove Order Warnings.
110+
See [examples](#remove-order-warnings) below for details.
108111

109112
### Loader Options
110113

@@ -391,7 +394,7 @@ module.exports = {
391394

392395
### Advanced configuration example
393396

394-
This plugin should be used only on `production` builds without `style-loader` in the loaders chain, especially if you want to have HMR in `development`.
397+
This plugin should not be used with `style-loader` in the loaders chain.
395398

396399
Here is an example to have both HMR in `development` and your styles extracted in a file for `production` builds.
397400

@@ -411,8 +414,8 @@ const plugins = [
411414
new MiniCssExtractPlugin({
412415
// Options similar to the same options in webpackOptions.output
413416
// both options are optional
414-
filename: devMode ? '[name].css' : '[name].[hash].css',
415-
chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
417+
filename: devMode ? '[name].css' : '[name].[contenthash].css',
418+
chunkFilename: devMode ? '[id].css' : '[id].[contenthash].css',
416419
}),
417420
];
418421
if (devMode) {
@@ -459,8 +462,8 @@ const plugins = [
459462
new MiniCssExtractPlugin({
460463
// Options similar to the same options in webpackOptions.output
461464
// both options are optional
462-
filename: devMode ? '[name].css' : '[name].[hash].css',
463-
chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
465+
filename: devMode ? '[name].css' : '[name].[contenthash].css',
466+
chunkFilename: devMode ? '[id].css' : '[id].[contenthash].css',
464467
}),
465468
];
466469
if (devMode) {

0 commit comments

Comments
 (0)