-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.prod.js
70 lines (69 loc) · 1.63 KB
/
webpack.config.prod.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
var path = require('path');
var Extract = require('extract-text-webpack-plugin');
var Manifest = require('webpack-manifest-plugin');
var webpack = require('webpack');
module.exports = {
entry: {
app:[
'babel-polyfill',
'./app/main.js'
]
},
output: {
path: path.join(process.cwd(), '.build'),
filename: '[name].[chunkhash].js',
chunkFilename: '[name].js',
publicPath: '/'
},
resolve: {
extensions: ['', '.js', '.jsx']
},
plugins: [
new Extract('[name].[chunkhash].css'),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.DefinePlugin({
__DEV__: false,
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.DedupePlugin(),
new Manifest({
fileName: 'chunk-manifest.json'
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
unused: true,
dead_code: true,
'warnings': false,
'drop_debugger': true,
'drop_console': true,
'pure_funcs': ['console.log']
}
})
],
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
include: path.join(__dirname, 'app')
},
{
test: /\.scss$/,
loader: Extract.extract('style-loader', 'raw-loader!sass-loader')
},
{
test: /\.json$/,
loader: 'json-loader'
}
]
},
sassLoader: {
includePaths: [
path.join(__dirname, 'node_modules/breakpoint-sass/stylesheets'),
path.join(__dirname, 'node_modules/bourbon/app/assets/stylesheets')
]
}
};