-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.dev.js
38 lines (36 loc) · 1.04 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
const merge = require('webpack-merge');
const webpackConfig = require('./webpack.config');
const webpack = require('webpack');
const path = require('path');
module.exports = merge(webpackConfig, {
devtool: 'eval-source-map',
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
host: '0.0.0.0',
port: parseInt(`${process.env.DEV_PORT}`, 10) || 8081,
hot: true,
watchContentBase: false,
historyApiFallback: true,
// stats: 'errors-only',
open: true,
openPage: '',
// Do something before app loads on a route
/* before(app) {
app.get('/', function (req, res) {
console.log('Before route..');
res.json({'a': 'a'})
});
}, */
// Do something before app loads on a route
/* after(app) {
app.get('/', function (req, res) {
console.log('After app ...');
res.json({ 'b': 'b' })
});
} */
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
});