-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.prod.config.js
More file actions
39 lines (37 loc) · 946 Bytes
/
webpack.prod.config.js
File metadata and controls
39 lines (37 loc) · 946 Bytes
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
'use strict'
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
devtool: 'cheap-module-source-map',
entry: ['./browser/js/app.js', './browser/scss/main.scss'],
output: {
path: __dirname + '/public',
filename: 'main.js'
},
resolve: {
extensions: ['', '.js', '.jsx', '.scss', '.css']
},
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.json$/, loader: 'json-loader' },
{
test: /\.s?css$/,
loader: ExtractTextPlugin.extract('style?sourceMap', 'css!sass?sourceMap')
}
]
},
plugins: [
new ExtractTextPlugin("style.css", {allChunks: true}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress:{
warnings: true
}
})
]
}