-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.prod.js
49 lines (48 loc) · 1.12 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
var webpack = require('webpack');
var path = require('path');
var autoprefixer = require('autoprefixer');
var PATHS = {
nodeModules: path.resolve(__dirname, 'node_modules'),
dist: path.resolve(__dirname, 'cumblr', 'static', 'js'),
main: path.resolve(__dirname, 'cumblr', 'src', 'js', 'index'),
src: path.resolve(__dirname, 'cumblr', 'src'),
fonts: path.resolve(__dirname, 'cumblr', 'static', 'fonts')
};
module.exports = {
entry: PATHS.main,
output: {
path: PATHS.dist,
filename: 'bundle.js'
},
module: {
loaders: [
{
exclude: [PATHS.nodeModules],
test: /\.js?$/,
loader: 'babel',
}
],
query: { presets: ['es2015'] }
},
resolve: {
extensions: ['', '.js']
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
},
output: {
comments: false
}
})
]
}