-
Notifications
You must be signed in to change notification settings - Fork 259
/
Copy pathwebpack.config.dev.babel.js
64 lines (62 loc) · 1.61 KB
/
webpack.config.dev.babel.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
import webpack from 'webpack';
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
import path from 'path';
/**
* Development webpack config designed to be loaded by express development server
*/
module.exports = {
/**
* The scripts in entry are combined in order to create our bundle
*/
mode: 'development',
entry: [
'babel-regenerator-runtime',
path.resolve(__dirname, 'src')
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
optimization: {
minimizer: [
// we specify a custom UglifyJsPlugin here to get source maps in production
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: false,
ecma: 6,
mangle: true
},
sourceMap: true
})
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
WEBPACK: true
}
}),
/*
* Uglifies JS which improves performance
* React will throw console warnings if this is not implemented
*/
],
resolve: {
extensions: ['.js', '.json', '.jsx'],
},
module: {
rules: [
{
test: /.jsx?$/,
use: {
loader: 'babel-loader'
},
include: path.resolve(__dirname, 'src')
}
]
}
};