Skip to content

Commit dfa645c

Browse files
EugeneHlushkomontogeek
authored andcommitted
docs(plugins) Add mini-css-extract-plugin (#2028)
* docs(plugins) Add mini-css-extract-plugin remove ETWP * docs(plugins) Remove extra space after hash * docs(guides) mini-css-extract-plugin updates in asset-management * feature(redirects) Dont delete ETWP info for now
1 parent a3fcdbc commit dfa645c

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/content/guides/asset-management.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ bundle.js 560 kB 0 [emitted] [big] main
139139

140140
Open up `index.html` in your browser again and you should see that `Hello webpack` is now styled in red. To see what webpack did, inspect the page (don't view the page source, as it won't show you the result) and look at the page's head tags. It should contain our style block that we imported in `index.js`.
141141

142-
Note that you can, and in most cases should, [split your CSS](/plugins/extract-text-webpack-plugin) for better load times in production. On top of that, loaders exist for pretty much any flavor of CSS you can think of -- [postcss](/loaders/postcss-loader), [sass](/loaders/sass-loader), and [less](/loaders/less-loader) to name a few.
142+
Note that you can, and in most cases should, [minimize css](/plugins/mini-css-extract-plugin/#minimizing-for-production) for better load times in production. On top of that, loaders exist for pretty much any flavor of CSS you can think of -- [postcss](/loaders/postcss-loader), [sass](/loaders/sass-loader), and [less](/loaders/less-loader) to name a few.
143143

144144

145145
## Loading Images

src/content/guides/production.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ __src/index.js__
237237
```
238238

239239

240-
## Split CSS
240+
## Minimize CSS
241241

242-
As mentioned in __Asset Management__ at the end of the [Loading CSS](/guides/asset-management#loading-css) section, it is typically best practice to split your CSS out to a separate file using the `ExtractTextPlugin`. There are some good examples of how to do this in the plugin's [documentation](/plugins/extract-text-webpack-plugin). The `disable` option can be used in combination with the `--env` flag to allow inline loading in development, which is recommended for Hot Module Replacement and build speed.
242+
It is crucial to minimize your CSS on production, please see [Minimizing for Production](/plugins/mini-css-extract-plugin/#minimizing-for-production) section.
243243

244244

245245
## CLI Alternatives

src/content/plugins/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Name | Description
3131
[`LimitChunkCountPlugin`](/plugins/limit-chunk-count-plugin) | Set min/max limits for chunking to better control chunking
3232
[`LoaderOptionsPlugin`](/plugins/loader-options-plugin) | Used for migrating from webpack 1 to 2
3333
[`MinChunkSizePlugin`](/plugins/min-chunk-size-plugin) | Keep chunk size above the specified limit
34+
[`MiniCssExtractPlugin`](/plugins/mini-css-extract-plugin) | creates a CSS file per JS file which requires CSS
3435
[`NoEmitOnErrorsPlugin`](/plugins/no-emit-on-errors-plugin) | Skip the emitting phase when there are compilation errors
3536
[`NormalModuleReplacementPlugin`](/plugins/normal-module-replacement-plugin) | Replace resource(s) that matches a regexp
3637
[`NpmInstallWebpackPlugin`](/plugins/npm-install-webpack-plugin) | Auto-install missing dependencies during development

src/scripts/fetch.sh

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ node ./src/scripts/fetch_package_names.js "peerigon" "extract-loader" | node ./s
1515

1616
# Fetch webpack-contrib (and various other) plugin repositories
1717
node ./src/scripts/fetch_package_names.js "webpack-contrib" "-webpack-plugin" | node ./src/scripts/fetch_package_files.js "README.md" "./generated/plugins"
18+
node ./src/scripts/fetch_package_names.js "webpack-contrib" "-extract-plugin" | node ./src/scripts/fetch_package_files.js "README.md" "./generated/plugins"
1819

1920
# Remove deprecated or archived plugins repositories
2021
rm ./generated/plugins/component-webpack-plugin.json ./generated/plugins/component-webpack-plugin.md

0 commit comments

Comments
 (0)