-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
43 lines (42 loc) · 1.07 KB
/
webpack.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
41
42
43
const path = require('path');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const webpack = require('webpack');
const express = require('express')
const DashboardPlugin = require('webpack-dashboard/plugin');
module.exports = merge(common, {
entry: [
'react-hot-loader/patch'
],
devtool: 'inline-source-map',
devServer: {
contentBase: './dist',
// do not print bundle build stats
noInfo: true,
// enable HMR
hot: true,
// embed the webpack-dev-server runtime into the bundle
inline: true,
// serve index.html in place of 404 responses to allow HTML5 history
historyApiFallback: true,
setup (app) {
app.use('/trips',
express.static(path.join(__dirname, 'trips')));
}
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
plugins: [
new DashboardPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
]
});