-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
54 lines (53 loc) · 1.24 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
var path = require('path');
var react = require('react');
var webpack = require('webpack');
module.exports = {
entry: path.resolve(__dirname, 'js/app.js'),
output: {
path: path.resolve(__dirname, 'build/'),
publicPath: '/build/',
filename: 'app.min.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
extensions: ['.jsx', '.js'],
query: {
presets: ['es2015', 'react']
}
},
{
test: /\.less$/,
loader: "style-loader!css-loader!less-loader"
},
{
test: /\.css$/,
loader: "style-loader!css-loader"
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
}
]
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.CommonsChunkPlugin({
children: true,
minChunks: 2,
}),
new webpack.optimize.MinChunkSizePlugin({
minChunkSize: 51200, // ~50kb
}),
new webpack.optimize.UglifyJsPlugin({
mangle: true,
compress: {
warnings: false
},
}),
]
};