diff options
| author | cedricnjanga | 2017-10-10 01:23:01 +0200 |
|---|---|---|
| committer | cedricnjanga | 2017-10-10 01:23:01 +0200 |
| commit | 91af53dce7183146f79313df48f7e58b4d950598 (patch) | |
| tree | 567d7cbeb064eefef6ef8aa787af6e0097618886 /config | |
| parent | 08b002abfb101b1edce9750231c989591e049bf7 (diff) | |
| download | chouette-core-91af53dce7183146f79313df48f7e58b4d950598.tar.bz2 | |
Add plugins to webpack config
Diffstat (limited to 'config')
| -rw-r--r-- | config/webpack/environment.js | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/config/webpack/environment.js b/config/webpack/environment.js index eb519b852..81ffcd55c 100644 --- a/config/webpack/environment.js +++ b/config/webpack/environment.js @@ -1,6 +1,34 @@ const { environment } = require('@rails/webpacker') -// const webpack = require('webpack') +const webpack = require('webpack') +const UglifyJsPlugin = require('uglify-js') +const CleanWebpackPlugin = require('clean-webpack-plugin') +let pathsToClean = [ + 'public/packs' +]; + +// the clean options to use +let cleanOptions = { + root: __dirname + '/../../', + verbose: true, + dry: false, + watch: true +}; + + +environment.plugins.set( + 'CleanWebpack', + new CleanWebpackPlugin(pathsToClean, cleanOptions) +) + +environment.plugins.set( + 'UglifyJs', + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + } + }) +) // environment.plugins.set('Provide', new webpack.ProvidePlugin({ // $: 'jquery', // jQuery: 'jquery', |
