-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
46 lines (41 loc) · 1.13 KB
/
webpack.config.dev.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
var path = require('path');
var webpack = require('webpack');
var app_config = require('./appconfig.js');
var devServer = app_config.getDevServer();
console.log((devServer.gatewayHost?devServer.gatewayHost:devServer.ip));
var entries = ['webpack-dev-server/client?http://' + (devServer.gatewayHost?devServer.gatewayHost:devServer.ip) + ':' + devServer.port,
'webpack/hot/only-dev-server'
];
for (var en in app_config.entry) {
if (app_config.entry.hasOwnProperty(en)) {
console.error('Pushing entry: ' + app_config.entry[en]);
entries.push(app_config.entry[en]);
}
}
module.exports = {
devtool: 'eval',
entry: entries,
output: {
path: path.join(__dirname, 'app/js'),
filename: 'bundle.js',
publicPath: '/debug/'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [{
test: /\.css$/,
loader: 'style!css'
}, {
test: /\.jsx$|\.js$/,
loaders: ['react-hot', 'babel'],
include: path.join(__dirname, 'src')
}]
},
resolve: {
root: path.resolve(__dirname, 'src'),
extensions: ['', '.jsx', '.js', '.css'],
alias: app_config.alias
}
};