forked from pubkey/rxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
executable file
·48 lines (46 loc) · 1.36 KB
/
webpack.config.js
File metadata and controls
executable file
·48 lines (46 loc) · 1.36 KB
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
40
41
42
43
44
45
46
47
48
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const path = require('path');
const commonConfig = require('./webpack.config.common.js');
const AppCachePlugin = require('appcache-webpack-plugin');
module.exports = function(options) {
const ENV = options.ENV || 'production';
return webpackMerge(commonConfig, {
plugins: [
// new webpack.optimize.DedupePlugin(),
new webpack.DefinePlugin({
'ENV': JSON.stringify(ENV)
}),
new webpack.NoErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({
// beautify: true, //debug
// mangle: false, //debug
// dead_code: false, //debug
// unused: false, //debug
// deadCode: false, //debug
// compress: {
// screw_ie8: true,
// keep_fnames: true,
// drop_debugger: false,
// dead_code: false,
// unused: false
// }, // debug
// comments: true, //debug
beautify: false, //prod
mangle: {
screw_ie8: true,
keep_fnames: true // required for ng2 rc.5
}, //prod
compress: { //prod
screw_ie8: true,
warnings: false
},
comments: false //prod
}),
new AppCachePlugin({
exclude: ['app.js', 'styles.css'],
output: 'app.appcache'
})
]
});
};