diff --git a/src/content/configuration/plugins.md b/src/content/configuration/plugins.md index 8f05b7a72b6b..41c0ef1cfee8 100644 --- a/src/content/configuration/plugins.md +++ b/src/content/configuration/plugins.md @@ -8,7 +8,7 @@ contributors: - byzyk --- -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 [this page](/plugins) for a list of plugins and documentation but note that there are a lot more out in the community. +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. T> Note: This page only discusses using plugins, however if you are interested in writing your own please visit [Writing a Plugin](/development/how-to-write-a-plugin/). @@ -17,14 +17,14 @@ T> Note: This page only discusses using plugins, however if you are interested i `array` -A list of webpack plugins. For example, when multiple bundles share some of the same dependencies, the `CommonsChunkPlugin` could be useful to extract those dependencies into a shared bundle to avoid duplication. This could be added like so: +A list of webpack plugins. For example, [`DefinePlugin`](/plugins/define-plugin/) allows you to create global constants which can be configured at compile time. This can be useful for allowing different behavior between development builds and release builds. ```js module.exports = { //... plugins: [ - new webpack.optimize.CommonsChunkPlugin({ - //... + new webpack.DefinePlugin({ + // Definitions... }) ] }; @@ -42,17 +42,6 @@ var DashboardPlugin = require('webpack-dashboard/plugin'); module.exports = { //... plugins: [ - // build optimization plugins - new webpack.optimize.CommonsChunkPlugin({ - name: 'vendor', - filename: 'vendor-[hash].min.js', - }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false, - drop_console: false, - } - }), new ExtractTextPlugin({ filename: 'build.min.css', allChunks: true,