Monty Taylor | 4a781a7 | 2017-07-25 07:28:04 -0400 | [diff] [blame^] | 1 | const path = require('path'); |
| 2 | const webpack = require('webpack'); |
| 3 | const Merge = require('webpack-merge'); |
| 4 | const CommonConfig = require('./webpack.common.js'); |
| 5 | const ArchivePlugin = require('webpack-archive-plugin'); |
| 6 | |
| 7 | module.exports = Merge(CommonConfig, { |
| 8 | output: { |
| 9 | filename: '[name].[chunkhash].js', |
| 10 | // path.resolve(__dirname winds up relative to the config dir |
| 11 | path: path.resolve(__dirname, '../../zuul/web/static'), |
| 12 | publicPath: '' |
| 13 | }, |
| 14 | plugins: [ |
| 15 | new webpack.LoaderOptionsPlugin({ |
| 16 | minimize: true, |
| 17 | debug: false |
| 18 | }), |
| 19 | new webpack.DefinePlugin({ |
| 20 | 'process.env': { |
| 21 | 'NODE_ENV': JSON.stringify('production') |
| 22 | } |
| 23 | }), |
| 24 | // Keeps the vendor bundle from changing needlessly. |
| 25 | new webpack.HashedModuleIdsPlugin(), |
| 26 | new webpack.optimize.UglifyJsPlugin({ |
| 27 | warningsFilter: function(filename) { |
| 28 | return ! /node_modules/.test(filename); |
| 29 | }, |
| 30 | beautify: false, |
| 31 | mangle: { |
| 32 | screw_ie8: true, |
| 33 | keep_fnames: true |
| 34 | }, |
| 35 | compress: { |
| 36 | screw_ie8: true |
| 37 | }, |
| 38 | sourceMap: true, |
| 39 | comments: false |
| 40 | }), |
| 41 | new ArchivePlugin({ |
| 42 | output: path.resolve(__dirname, '../../zuul-web'), |
| 43 | format: [ |
| 44 | 'tar', |
| 45 | ], |
| 46 | ext: 'tgz' |
| 47 | }) |
| 48 | ] |
| 49 | }) |