From 976468f8677df067bca94ebeca65864027d153e6 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Tue, 14 Aug 2018 15:48:18 +0300 Subject: [PATCH 1/2] docs(config) update configuration plugins page --- src/content/configuration/plugins.md | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/content/configuration/plugins.md b/src/content/configuration/plugins.md index 8f05b7a72b6b..67856b9de1e4 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,15 +17,15 @@ 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, From 5f24b92ffbac0d884cc38814cc48138fabb3624d Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Tue, 14 Aug 2018 15:48:30 +0300 Subject: [PATCH 2/2] docs(config) update configuration plugins page --- src/content/configuration/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/configuration/plugins.md b/src/content/configuration/plugins.md index 67856b9de1e4..41c0ef1cfee8 100644 --- a/src/content/configuration/plugins.md +++ b/src/content/configuration/plugins.md @@ -25,7 +25,7 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ // Definitions... - }); + }) ] }; ```