Files: 5b2e405d30a0a28a8d6b43dd4ec8b16cdba28cf8 / build / webpack.dev.conf.js
1225 bytesRaw
1 | var utils = require('./utils') |
2 | var webpack = require('webpack') |
3 | var config = require('../config') |
4 | var merge = require('webpack-merge') |
5 | var baseWebpackConfig = require('./webpack.base.conf') |
6 | var HtmlWebpackPlugin = require('html-webpack-plugin') |
7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') |
8 | |
9 | // add hot-reload related code to entry chunks |
10 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { |
11 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) |
12 | }) |
13 | |
14 | module.exports = merge(baseWebpackConfig, { |
15 | module: { |
16 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) |
17 | }, |
18 | // cheap-module-eval-source-map is faster for development |
19 | devtool: '#cheap-module-eval-source-map', |
20 | plugins: [ |
21 | new webpack.DefinePlugin({ |
22 | 'process.env': config.dev.env |
23 | }), |
24 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage |
25 | new webpack.HotModuleReplacementPlugin(), |
26 | new webpack.NoEmitOnErrorsPlugin(), |
27 | // https://github.com/ampedandwired/html-webpack-plugin |
28 | new HtmlWebpackPlugin({ |
29 | filename: 'index.html', |
30 | template: 'index.html', |
31 | inject: true |
32 | }), |
33 | new FriendlyErrorsPlugin() |
34 | ] |
35 | }) |
36 |
Built with git-ssb-web