forked from jankopriva/devstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
41 lines (33 loc) · 1.04 KB
/
Copy pathwebpack.dev.config.js
File metadata and controls
41 lines (33 loc) · 1.04 KB
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
var _ = require('lodash');
var path = require('path');
var webpack = require('webpack');
var getWebpackConfig = require('./webpack.config.js');
var devConfig = _.assign(getWebpackConfig(), {
devtool: 'inline-source-map',
output: {
path: path.join(__dirname, '/app/'),
// Specify complete path to force
// chrome/FF load the images
publicPath: 'http://localhost:3000/app/',
filename: '[name].js'
}
});
_.keysIn(devConfig.entry).forEach(function(key) {
var currentValue = devConfig.entry[key];
devConfig.entry[key] = currentValue.concat(
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server'
);
});
devConfig.module.loaders.forEach(function(loaderDef) {
if (loaderDef.test.toString().indexOf('.js') > 0) {
loaderDef.loader = 'react-hot!' + loaderDef.loader;
}
});
devConfig.plugins = devConfig.plugins.concat(
new webpack.DefinePlugin({
DEBUG: true
}),
new webpack.NoErrorsPlugin()
);
module.exports = devConfig;