-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.production.js
More file actions
55 lines (54 loc) · 1.25 KB
/
Copy pathwebpack.production.js
File metadata and controls
55 lines (54 loc) · 1.25 KB
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
var path = require('path'),
webpack = require('webpack'),
AssetsPlugin = require('assets-webpack-plugin');
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8081',
'webpack/hot/only-dev-server',
'./src/js/main.jsx'
],
output: {
path: path.join(__dirname, 'public/js'),
filename: 'app.[chunkhash].js',
publicPath: '/js/',
vendor: ['react',
'react-router',
'lodash',
'velocity-animate',
'bluebird']
},
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
module: {
loaders: [{
test: /\.jsx$/,
loader: 'babel?stage=0',
include: path.join(__dirname, 'src/js')
}]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.optimize.CommonsChunkPlugin(
'vendor',
'libs.[hash].js'
),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
},
output: {
comments: false
}
}),
new webpack.optimize.DedupePlugin(),
new AssetsPlugin({
path: path.join(__dirname, 'routes'),
filename: 'assets.json'
})
],
resolve: {
extensions: ['', '.js', '.jsx']
}
};