-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
40 lines (33 loc) · 1.02 KB
/
Copy pathwebpack.dev.config.js
File metadata and controls
40 lines (33 loc) · 1.02 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
var _ = require('lodash');
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var getWebpackConfig = require('./webpack.config.js');
var devConfig = _.assign(getWebpackConfig(), {
devtool: 'cheap-inline-source-map',
output: {
path: path.join(__dirname, '/'),
// Specify complete path to force
// chrome/FF load the images
publicPath: 'http://localhost:3000/',
filename: '[name].js'
}
});
_.keysIn(devConfig.entry).forEach(function(key) {
var currentValue = devConfig.entry[key];
devConfig.entry[key] = [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'react-hot-loader/patch'
].concat(currentValue);
});
devConfig.plugins = devConfig.plugins.concat(
new webpack.DefinePlugin({
DEBUG: true
}),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
template: 'index.webpack.html'
})
);
module.exports = devConfig;