blob: 79f5d51568abc4a6f72ef189635bd5f04daa5197 [file] [log] [blame]
Monty Taylor4a781a72017-07-25 07:28:04 -04001const path = require('path');
2const webpack = require('webpack');
3const Merge = require('webpack-merge');
4const CommonConfig = require('./webpack.common.js');
5const ArchivePlugin = require('webpack-archive-plugin');
6
7module.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})