-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
executable file
·64 lines (63 loc) · 1.36 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
55
56
57
58
59
60
61
62
63
64
/* eslint-disable */
const webpack = require('webpack');
module.exports = {
entry: {
vendor: [
'@blueprintjs/core',
'@blueprintjs/datetime',
'@blueprintjs/table',
'classnames',
'lodash',
'dcharts',
'debug',
'influx-ql',
'moment',
'react',
'react-dom',
'react-enroute',
'react-redux',
'redux',
'redux-logger',
'redux-thunk',
'superagent',
],
app: './public/js/bootstrap.js',
},
// devtool: 'source-map',
output: {
path: __dirname + '/public/bundle',
filename: '[name].js',
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
query: {
presets: ['es2015', 'react'],
cacheDirectory: true,
},
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
},
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
// filename: "vendor.js"
// (Give the chunk a different name)
minChunks: Infinity,
// (with more entries, this ensures that no other module
// goes into the vendor chunk)
}),
new webpack.SourceMapDevToolPlugin({
test: /\.js$/,
exclude: /vendor.js/,
filename: '[name].[chunkhash].map',
}),
],
};