UNPKG

1.04 kBJavaScriptView Raw
1var webpack = require('webpack')
2var merge = require('webpack-merge')
3var baseConfig = require('./webpack.base.conf')
4var HtmlWebpackPlugin = require('html-webpack-plugin')
5
6// add hot-reload related code to entry chunks
7Object.keys(baseConfig.entry).forEach(function (name) {
8 baseConfig.entry[name] = ['./build/dev-client'].concat(baseConfig.entry[name])
9})
10
11module.exports = merge(baseConfig, {
12 // eval-source-map is faster for development
13 devtool: '#eval-source-map',
14 output: {
15 // necessary for the html plugin to work properly
16 // when serving the html from in-memory
17 publicPath: '/'
18 },
19 plugins: [
20 // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
21 new webpack.optimize.OccurenceOrderPlugin(),
22 new webpack.HotModuleReplacementPlugin(),
23 new webpack.NoErrorsPlugin(),
24 // https://github.com/ampedandwired/html-webpack-plugin
25 new HtmlWebpackPlugin({
26 filename: 'index.html',
27 template: 'index.html',
28 inject: true
29 })
30 ]
31})