-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
33 lines (33 loc) · 916 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 path = require('path')
var webpack = require('webpack')
module.exports = {
watch: true,
entry: {
'index': 'index',
'vendor': ['react', 'redux', 'react-redux', 'classnames', 'whatwg-fetch']
},
output: {
path: path.join(__dirname, 'public/js/dest'),
filename: '[name].bundle.js'
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader?stage=0&optional[]=runtime'
}]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js"),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
],
resolve: {
extensions: ["", ".js", ".jsx", '.es6'],
root: path.join(__dirname, '/public/js/src/'),
modulesDirectories: ["node_modules"]
}
}