-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.hot.config.js
More file actions
45 lines (38 loc) · 1.24 KB
/
webpack.hot.config.js
File metadata and controls
45 lines (38 loc) · 1.24 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
42
43
44
45
'use strict';
var webpack = require ('webpack');
var config = require('./webpack.config.js');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
var styleLintPlugin = require('./webpack/linters/stylelint');
var rules = require('./webpack/rules');
const hotRules = rules({
hot: true,
dirname: __dirname
});
module.exports = Object.assign({}, config, {
devtool: 'cheap-module-source-map',
entry: Object.assign({}, config.entry, {
vendors: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'react-hot-loader/patch'
]
}),
output: Object.assign({}, config.output, {
filename: '[name].[hash].js',
publicPath: '/dist'
}),
plugins: config.plugins.concat([
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new ProgressBarPlugin(),
new HtmlWebpackHarddiskPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendors'
}),
styleLintPlugin
]),
module: Object.assign({}, config.module, {
rules: config.module.rules.concat(hotRules)
})
});