forked from mathieuancelin/react-context-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (44 loc) · 1.04 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
var webpack = require('webpack');
var plugins = [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'__DEV__': process.env.NODE_ENV === 'production' ? false : true,
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
];
if (process.env.NODE_ENV === 'dev') {
plugins.push(new webpack.HotModuleReplacementPlugin());
plugins.push(new webpack.NoErrorsPlugin());
} else {
plugins.push(new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compressor: {
screw_ie8: true,
warnings: false
}
}));
}
module.exports = {
output: {
path: './dist/',
publicPath: '/assets/',
filename: 'react-context-utils.js',
library: 'ReactContextUtils',
libraryTarget: 'umd'
},
entry: './src/index.js',
resolve: {
extensions: ['', '.js', '.jsx', 'es6']
},
module: {
loaders: [
{
test: /\.js|\.jsx|\.es6$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
plugins: plugins
};