forked from Nabrok/gw2-discord-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
32 lines (31 loc) · 1.02 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
var webpack = require('webpack');
module.exports = {
entry: {
app: './features/web/client/index.js',
vendor: ['react', 'react-dom', 'flux', 'react-bootstrap', 'react-router', 'react-router-bootstrap', 'socket.io-client', 'superagent', 'jwt-decode', 'react-markdown']
},
output: {
path: './features/web/public',
filename: 'bundle.js',
publicPath: ''
},
plugins: process.env.NODE_ENV === 'production' ? [
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js"),
new webpack.ExtendedAPIPlugin(),
new webpack.DefinePlugin({
'process.env': { 'NODE_ENV': JSON.stringify('production') }
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin()
] : [
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js"),
new webpack.ExtendedAPIPlugin()
],
module: {
loaders: [
{ test: /\.jsx?/, exclude: /node_modules/, loader: 'babel-loader?presets[]=es2015&presets[]=react' },
{ test: /\.json$/, loader: 'json' }
]
}
};