-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
40 lines (37 loc) · 911 Bytes
/
webpack.config.js
File metadata and controls
40 lines (37 loc) · 911 Bytes
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 path = require('path')
var webpack = require('webpack')
module.exports = {
devtool: 'eval-source-map',
entry: ['react-hot-loader/patch', path.resolve('src/index.js')],
output: {
filename: 'bundle.js',
path: path.resolve('dist'),
publicPath: '/dist/',
},
module: {
rules: [
{
test: /\.js$/,
use: ['babel-loader'],
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
exclude: /node_modules/,
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
// enable HMR globally
new webpack.NamedModulesPlugin(),
// prints more readable module names in the browser console on HMR updates
new webpack.NoEmitOnErrorsPlugin(),
// do not emit compiled assets that include errors
],
devServer: {
hot: true,
historyApiFallback: true,
},
}