You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+32-8
Original file line number
Diff line number
Diff line change
@@ -1131,6 +1131,38 @@ module.exports = {
1131
1131
1132
1132
## Examples
1133
1133
1134
+
### Recommend
1135
+
1136
+
For `production` builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
1137
+
This can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin), because it creates separate css files.
1138
+
For `development` mode (including `webpack-dev-server`) you can use [style-loader](https://github.com/webpack-contrib/style-loader), because it injects CSS into the DOM using multiple <style></style> and works faster.
1139
+
1140
+
> i Do not use together `style-loader` and `mini-css-extract-plugin`.
### Disable url resolving using the `/* webpackIgnore: true */` comment
1135
1167
1136
1168
With the help of the `/* webpackIgnore: true */`comment, it is possible to disable sources handling for rules and for individual declarations.
@@ -1235,14 +1267,6 @@ module.exports = {
1235
1267
};
1236
1268
```
1237
1269
1238
-
### Extract
1239
-
1240
-
For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
1241
-
1242
-
- This can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract the CSS when running in production mode.
1243
-
1244
-
- As an alternative, if seeking better development performance and css outputs that mimic production. [extract-css-chunks-webpack-plugin](https://github.com/faceyspacey/extract-css-chunks-webpack-plugin) offers a hot module reload friendly, extended version of mini-css-extract-plugin. HMR real CSS files in dev, works like mini-css in non-dev
1245
-
1246
1270
### Pure CSS, CSS modules and PostCSS
1247
1271
1248
1272
When you have pure CSS (without CSS modules), CSS modules and PostCSS in your project you can use this setup:
0 commit comments