-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.dev.js
43 lines (40 loc) · 1.24 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
41
42
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const webpackConfig = require('./webpack.config');
const TARGET = process.env.npm_lifecycle_event;
process.env.BABEL_ENV = TARGET;
module.exports = merge(webpackConfig, {
devtool: 'eval-source-map',
devServer: {
contentBase: path.join(__dirname, 'dist'),
// 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,
inline: true,
// Display only errors to reduce the amount of output.
stats: 'errors-only',
// 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:8000',
secure: false
}
}
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
// new DashboardPlugin()
]
});