Skip to content
5 changes: 0 additions & 5 deletions repositories/plugins.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
[
"webpack-contrib/i18n-webpack-plugin",
"webpack-contrib/compression-webpack-plugin",
"webpack-contrib/extract-text-webpack-plugin",
"webpack-contrib/copy-webpack-plugin",
"webpack-contrib/npm-install-webpack-plugin",
"webpack-contrib/stylelint-webpack-plugin",
"webpack-contrib/babel-minify-webpack-plugin",
"webpack-contrib/uglifyjs-webpack-plugin",
"webpack-contrib/zopfli-webpack-plugin",
"webpack-contrib/closure-webpack-plugin",
"webpack-contrib/mini-css-extract-plugin",
"webpack-contrib/terser-webpack-plugin"
Expand Down
12 changes: 0 additions & 12 deletions src/components/Organization/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@
"description": "Source code handling classes for webpack.",
"maintainer": ""
},
{
"repo": "webpack-contrib/extract-text-webpack-plugin",
"npm": "extract-text-webpack-plugin",
"description": "Extract text from a bundle into a file.",
"maintainer": ""
},
{
"repo": "webpack-contrib/sass-loader",
"npm": "sass-loader",
Expand Down Expand Up @@ -234,12 +228,6 @@
"description": "Load and execute a module while compiling, returning the result.",
"maintainer": ""
},
{
"repo": "webpack-contrib/i18n-webpack-plugin",
"npm": "i18n-webpack-plugin",
"description": "Embed localization into your bundle.",
"maintainer": ""
},
{
"repo": "webpack-contrib/json5-loader",
"npm": "json5-loader",
Expand Down
3 changes: 1 addition & 2 deletions src/content/configuration/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ contributors:
- jamesgeorge007
- hiroppy
- chenxsan
- snitin315
---

The top-level `output` key contains set of options instructing webpack on how and where it should output your bundles, assets and anything else you bundle or load with webpack.
Expand Down Expand Up @@ -366,8 +367,6 @@ Example: `[\id\]` generates `[id]` instead of getting replaced with the `id`.

If using a function for this option, the function will be passed an object containing the substitutions in the table above.

T> When using the [`ExtractTextWebpackPlugin`](/plugins/extract-text-webpack-plugin), use `[contenthash]` to obtain a hash of the extracted file (neither `[hash]` nor `[chunkhash]` work).

## `output.assetModuleFilename`

The same as [`output.filename`](#outputfilename) but for [Asset Modules](/guides/asset-modules/)
Expand Down
6 changes: 1 addition & 5 deletions src/content/configuration/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contributors:
- yatharthk
- byzyk
- EugeneHlushko
- snitin315
---

The `plugins` option is used to customize the webpack build process in a variety of ways. webpack comes with a variety built-in plugins available under `webpack.[plugin-name]`. See [Plugins page](/plugins) for a list of plugins and documentation but note that there are a lot more out in the community.
Expand Down Expand Up @@ -40,17 +41,12 @@ __webpack.config.js__
```js
var webpack = require('webpack');
// importing plugins that do not come by default in webpack
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var DashboardPlugin = require('webpack-dashboard/plugin');

// adding plugins to your configuration
module.exports = {
//...
plugins: [
new ExtractTextPlugin({
filename: 'build.min.css',
allChunks: true,
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// compile time plugins
new webpack.DefinePlugin({
Expand Down
2 changes: 1 addition & 1 deletion src/content/guides/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ contributors:
- wizardofhogwarts
- aholzner
- EugeneHlushko
- snitin315
---

In this guide, we'll dive into some of the best practices and utilities for building a production site or application.
Expand Down Expand Up @@ -201,7 +202,6 @@ webpack v4+ will minify your code by default in [`production mode`](/configurati

Note that while the [`TerserPlugin`](/plugins/terser-webpack-plugin/) is a great place to start for minification and being used by default, there are other options out there:

- [`BabelMinifyWebpackPlugin`](https://github.com/webpack-contrib/babel-minify-webpack-plugin)
- [`ClosureWebpackPlugin`](https://github.com/webpack-contrib/closure-webpack-plugin)

If you decide to try another minification plugin, just make sure your new choice also drops dead code as described in the [tree shaking](/guides/tree-shaking) guide and provide it as the [`optimization.minimizer`](/configuration/optimization/#optimizationminimizer).
Expand Down
17 changes: 1 addition & 16 deletions src/content/plugins/commons-chunk-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ contributors:
- jeremenichelli
- byzyk
- madhavarshney
- snitin315
---

The `CommonsChunkPlugin` is an opt-in feature that creates a separate file (known as a chunk), consisting of common modules shared between multiple entry points.
Expand Down Expand Up @@ -216,22 +217,6 @@ new webpack.optimize.CommonsChunkPlugin({
});
```

In order to obtain a single CSS file containing your application and vendor CSS, use the following `minChunks` function together with [`ExtractTextPlugin`](/plugins/extract-text-webpack-plugin/):

```javascript
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module) {
// This prevents stylesheet resources with the .css or .scss extension
// from being moved from their original chunk to the vendor chunk
if(module.resource && (/^.*\.(css|scss)$/).test(module.resource)) {
return false;
}
return module.context && module.context.includes('node_modules');
}
});
```

## Manifest file

To extract the webpack bootstrap logic into a separate file, use the `CommonsChunkPlugin` on a `name` which is not defined as `entry`. Commonly the name `manifest` is used. See the [caching guide](/guides/caching) for details.
Expand Down
5 changes: 1 addition & 4 deletions src/content/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ contributors:
- refactorized
- byzyk
- EugeneHlushko
- snitin315
---

webpack has a rich plugin interface. Most of the features within webpack itself use this plugin interface. This makes webpack __flexible__.

Name | Description
-------------------------------------------------------- | -----------
[`BabelMinifyWebpackPlugin`](/plugins/babel-minify-webpack-plugin) | Minification with [babel-minify](https://github.com/babel/minify)
[`BannerPlugin`](/plugins/banner-plugin) | Add a banner to the top of each generated chunk
[`CommonsChunkPlugin`](/plugins/commons-chunk-plugin) | Extract common modules shared between chunks
[`CompressionWebpackPlugin`](/plugins/compression-webpack-plugin) | Prepare compressed versions of assets to serve them with Content-Encoding
Expand All @@ -25,10 +25,8 @@ Name | Description
[`DefinePlugin`](/plugins/define-plugin) | Allow global constants configured at compile time
[`DllPlugin`](/plugins/dll-plugin) | Split bundles in order to drastically improve build time
[`EnvironmentPlugin`](/plugins/environment-plugin) | Shorthand for using the [`DefinePlugin`](/plugins/define-plugin) on `process.env` keys
[`ExtractTextWebpackPlugin`](/plugins/extract-text-webpack-plugin) | Extract text (CSS) from your bundles into a separate file
[`HotModuleReplacementPlugin`](/plugins/hot-module-replacement-plugin) | Enable Hot Module Replacement (HMR)
[`HtmlWebpackPlugin`](/plugins/html-webpack-plugin) | Easily create HTML files to serve your bundles
[`I18nWebpackPlugin`](/plugins/i18n-webpack-plugin) | Add i18n support to your bundles
[`IgnorePlugin`](/plugins/ignore-plugin) | Exclude certain modules from bundles
[`LimitChunkCountPlugin`](/plugins/limit-chunk-count-plugin) | Set min/max limits for chunking to better control chunking
[`MinChunkSizePlugin`](/plugins/min-chunk-size-plugin) | Keep chunk size above the specified limit
Expand All @@ -41,6 +39,5 @@ Name | Description
[`SourceMapDevToolPlugin`](/plugins/source-map-dev-tool-plugin) | Enables a more fine grained control of source maps
[`EvalSourceMapDevToolPlugin`](/plugins/eval-source-map-dev-tool-plugin) | Enables a more fine grained control of eval source maps
[`TerserPlugin`](/plugins/terser-webpack-plugin/) | Uses Terser to minify the JS in your project
[`ZopfliWebpackPlugin`](/plugins/zopfli-webpack-plugin) | Prepare compressed versions of assets with node-zopfli

For more third-party plugins, see the list from [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#webpack-plugins).