-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.dev.js
40 lines (38 loc) · 1.16 KB
/
webpack.config.dev.js
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
/**
* DEVELOPMENT WEBPACK CONFIGURATION
*/
const path = require('path')
const webpack = require('webpack')
const CircularDependencyPlugin = require('circular-dependency-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = require('./webpack.config.base')({
// Add hot reloading in development
entry: [
'babel-polyfill',
'webpack-hot-middleware/client?reload=true',
path.join(__dirname, 'src/index.js') // Start with src/index.js
],
output: {
filename: '[name].[hash].js'
},
module: {
test: /\.sass/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
}),
new webpack.HotModuleReplacementPlugin(), // Tell webpack we want hot reloading
new webpack.NoEmitOnErrorsPlugin(),
new HtmlWebpackPlugin({
inject: true, // Inject all files that are generated by webpack, e.g. bundle.js
template: 'public/index.html',
}),
new CircularDependencyPlugin({
exclude: /a\.js|node_modules/, // exclude node_modules
failOnError: false, // show a warning when there is a circular dependency
})
],
devtool: 'source-map'
})