-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
43 lines (41 loc) · 981 Bytes
/
webpack.prod.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
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const extractSass = new ExtractTextPlugin('all.css');
module.exports = {
entry: {
all: __dirname + '/source/javascripts/index.js',
},
resolve: {
root: __dirname + '/source/javascripts',
},
output: {
path: __dirname + '/.tmp/webpack_output',
filename: '/javascripts/[name].js'
},
module: {
loaders: [
{
test: /.*\.sass$/,
loader: extractSass.extract(['css', 'sass', 'import-glob'])
},
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
query: { presets: ['es2015'] }
}
]
},
plugins: [
extractSass,
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
comments: false,
}),
]
};