forked from kaivi/riek
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
46 lines (45 loc) · 1017 Bytes
/
webpack.config.js
File metadata and controls
46 lines (45 loc) · 1017 Bytes
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
const Webpack = require('webpack');
const path = require('path');
const DOCROOT = path.resolve(__dirname);
module.exports = {
entry: {
app: './src/index.js',
},
output: {
path: DOCROOT + '/demo',
filename: 'demo.js',
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
},
],
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
plugins: [
new Webpack.optimize.AggressiveMergingPlugin(),
new Webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compressor: {
dead_code: true,
warnings: true,
drop_debugger: true,
passes: 1,
},
comments: false,
beautify: false,
mangle: {
except: ['$'], // Don't mangle $
screw_ie8 : true, // Don't care about IE8
keep_fnames: false, // Don't mangle function names
},
}
),
],
};