forked from danielstern/isomorphic-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.babel.js
45 lines (44 loc) · 1.15 KB
/
webpack.config.prod.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
const path = require('path');
const webpack = require('webpack');
/**
* Production Webpack Config bundles JS, then uglifies it and exports it to the "dist" directory
* See Development webpack config for detailed comments
*/
module.exports = {
entry: [
'babel-regenerator-runtime',
path.resolve(__dirname, 'src')
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
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
*/
new webpack.optimize.UglifyJsPlugin()
],
resolve: {
extensions: ['.js', '.json', '.jsx'],
},
module: {
loaders: [
{
test: /\.jsx?$/,
use: {
loader: 'babel-loader'
},
include: path.resolve(__dirname, 'src')
}
]
}
};