-
Notifications
You must be signed in to change notification settings - Fork 14
/
webpack.config.js
82 lines (78 loc) · 1.57 KB
/
webpack.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* eslint-disable */
var webpack = require('webpack');
var reactExternal = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
};
var reduxExternal = {
root: 'Redux',
commonjs2: 'redux',
commonjs: 'redux',
amd: 'redux'
};
var reactReduxExternal = {
root: 'ReactRedux',
commonjs2: 'react-redux',
commonjs: 'react-redux',
amd: 'react-redux'
};
module.exports = {
externals: {
react: reactExternal,
redux: reduxExternal,
reactRedux: reactReduxExternal
},
entry: './lib/index.js',
output: {
path: './dist',
filename: 'index.js',
library: 'Relate',
libraryTarget: 'umd'
},
resolve: {
extensions: ['', '.js', '.jsx', '.json']
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
mangle: true,
minimize: true,
sourceMap: false,
output: {
comments: false
},
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true,
warnings: false
}
}),
new webpack.optimize.DedupePlugin()
],
module: {
loaders: [
{
test: /\.(js|jsx)$/,
loader: 'babel',
exclude: /node_modules/,
query: {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['lodash']
}
}
]
}
};