forked from mayawang/tic-tac-toe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
52 lines (47 loc) · 963 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var webpack = require('webpack');
var DashboardPlugin = require('webpack-dashboard/plugin');
var merge = require('webpack-merge');
var common = {
entry: ['babel-polyfill', './src/app.js'],
output: {
path: './build',
filename: 'app.bundle.js'
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}]
}
};
var production = {
output: {
publicPath: '/set/'
}
};
var development = {
devtool: 'source-map',
devServer: {
contentBase: './build',
historyApiFallback: true,
hot: true,
inline: true,
port: 8081
},
plugins: [
new webpack.HotModuleReplacementPlugin({
multiStep: true
}),
new DashboardPlugin()
]
};
var buildTarget = process.env.npm_lifecycle_event;
switch(buildTarget) {
case 'build':
module.exports = merge(common, production);
break;
default:
module.exports = merge(common, development);
break;
}