-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
43 lines (41 loc) · 1.31 KB
/
webpack.config.dev.js
File metadata and controls
43 lines (41 loc) · 1.31 KB
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 webpackConfig = require('./webpack.config');
const DashboardPlugin = require('webpack-dashboard/plugin');
const PATHS = {
build: path.join(__dirname, 'production'),
};
module.exports = merge(webpackConfig, {
devtool: 'source-map',
stats: 'errors-only',
devServer: {
// contentBase: PATHS.build, // in earlier webpack versions
static: {
directory: PATHS.build
},
// Enable history API fallback so HTML5 History API based
// routing works. This is a good default that will come
// in handy in more complicated setups.
historyApiFallback: true,
hot: true,
// Display only errors to reduce the amount of output.
// Parse host and port from env so this is easy to customize.
//
// If you use Vagrant or Cloud9, set
// host: process.env.HOST || '0.0.0.0';
//
// 0.0.0.0 is available to all network devices unlike default
// localhost
host: process.env.HOST,
port: process.env.PORT,
proxy: {
'/api/**': {
target: 'http://localhost:4000',
secure: false
}
}
},
plugins: [
new DashboardPlugin()
]
});