forked from national-treasures-tw/landing-page
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.production.config.js
45 lines (44 loc) · 1019 Bytes
/
webpack.production.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
var path = require('path');
var webpack = require("webpack");
module.exports = {
entry: [
path.resolve(__dirname, 'app/main.js')
],
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/'
},
module: {
loaders: [
{
test: /\.js$/, exclude: /node_modules/, loader: 'babel'
},
{
test: /\.css$/, loader: 'style!css?modules'
},
{
test: /\.jpe?g$|\.gif$|\.pdf$|\.docx|\.ttf|\.png$|\.svg$/i,
loader: 'url-loader',
query: { limit: 20000 }
}
]
},
plugins: [
// Order the modules and chunks by occurrence.
// This saves space, because often referenced modules
// and chunks get smaller ids.
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
}),
// turn on for production builds
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
})
]
}