-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.config.js
52 lines (48 loc) · 1.34 KB
/
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
46
47
48
49
50
51
52
'use strict';
var path = require('path');
var webpack = require('webpack');
var buildPath = path.join(__dirname, 'public', 'assets');
var entry = path.join(__dirname, 'app', 'app.js');
module.exports = {
// real source-map for production
devtool: 'source-map',
entry: [
// sets up an ES6-ish environment with promise support
'babel-polyfill',
// the main application script
entry
],
output: {
path: buildPath,
filename: 'bundle.js',
publicPath: '/assets/' // need for hot reload. or hit refresh each time
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
minimize: true,
compress: {
warnings: false
}
})
],
module: {
loaders: [
{
test: /\.jsx?$/,
include: path.join(__dirname, 'app'),
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['es2015', 'stage-0']
}
},
{
test: /\.scss$/,
include: path.join(__dirname, 'app', 'scss'),
loader: 'style!css!sass'
}
]
}
};