-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
54 lines (52 loc) · 1.31 KB
/
webpack.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
53
54
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
var webpack = require('webpack');
module.exports = {
context: __dirname,
entry: './src/index.js',
devtool: 'source-map',
output: {
path: `${__dirname}/build`,
filename: 'bundle.js',
publicPath: '/build',
},
module: {
loaders: [
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel'
},
{ test: /\.(png|jpg)$/,
include: [/os-icons/],
loader: 'url-loader?name=/src/assets/os-icons/[name].[ext]' },
{
test: /\.(jpg|png|gif|svg)$/i,
exclude: [/os-icons/],
loaders: [
'file?hash=sha512&digest=hex&name=/assets/[hash].[ext]',
'image-webpack?optimizationLevel=7&interlaced=false'
]
}
],
},
stats: {
warnings: false
},
resolve: {
extensions: ['', '.js', '.jsx']
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.DedupePlugin(), //dedupe similar code
new webpack.optimize.UglifyJsPlugin(), //minify everything
new webpack.optimize.AggressiveMergingPlugin()//Merge chunks
]
};