-
Notifications
You must be signed in to change notification settings - Fork 10
/
webpack.config.js
33 lines (32 loc) · 915 Bytes
/
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
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
var definePlugin = webpack.DefinePlugin;
module.exports = {
entry: './demo/index.jsx',
output: {
path: './demo/dist/',
filename: 'bundle.js'
},
module: {
loaders:[{
test: /\.js[x]?$/,
exclude: /node_modules/,
loader: 'babel-loader?presets[]=es2015&presets[]=react&presets[]=stage-0'
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract(
'style',
'css'
, { publicPath: '../' })
}, {
test: /\.(png|jpg)$/,
loader: 'url-loader?limit=512'
}]
},
plugins: [
new ExtractTextPlugin('bundle.css', { allChunks: true }),
new uglifyJsPlugin({compress: {warnings: false}}),
new definePlugin({'process.env': {NODE_ENV: '"production"'}})
]
};