forked from CenterForOpenScience/osf.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
39 lines (37 loc) · 1.42 KB
/
webpack.prod.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var webpack = require('webpack');
var common = require('./webpack.common.config.js');
var assign = require('object-assign');
var SaveAssetsJson = require('assets-webpack-plugin');
module.exports = assign(common, {
debug: false,
stats: {reasons: false},
plugins: common.plugins.concat([
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
},
DEBUG: false,
'__DEV__': false
}),
new webpack.optimize.UglifyJsPlugin({
exclude: /conference.*?\.js$/,
compress: {warnings: false}
}),
// Save a webpack-assets.json file that maps base filename to filename with
// hash. This file is used by the webpack_asset mako filter to expand
// base filenames to full filename with hash.
new SaveAssetsJson(),
// Append hash to commons chunk for cachebusting
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.[hash].js'),
]),
output: {
path: './website/static/public/js/',
// publicPath: '/static/', // used to generate urls to e.g. images
// Append hash to filenames for cachebusting
filename: '[name].[chunkhash].js',
sourcePrefix: ''
}
});