@@ -5,7 +5,6 @@ import opn from 'opn';
55import path from 'path' ;
66import express from 'express' ;
77import webpack from 'webpack' ;
8- import proxyMiddleware from 'http-proxy-middleware' ;
98import webpackDevMiddleware from 'webpack-dev-middleware' ;
109import webpackHotMiddleware from 'webpack-hot-middleware' ;
1110import connectionHistoryApiFallback from 'connect-history-api-fallback' ;
@@ -20,7 +19,6 @@ if (!process.env.NODE_ENV) {
2019const host = process . env . HOST || config . dev . host ;
2120const port = process . env . PORT || config . dev . port ;
2221const autoOpenBrowser = ! ! config . dev . autoOpenBrowser ;
23- const { proxyTable } = config . dev ;
2422
2523const app = express ( ) ;
2624const compiler = webpack ( webpackConfig ) ;
@@ -36,22 +34,14 @@ const hotMiddleware = webpackHotMiddleware(compiler, {
3634} ) ;
3735
3836
39- compiler . plugin ( 'compilation' , ( compilation ) => {
40- compilation . plugin ( 'html-webpack-plugin-after-emit' , ( data , cb ) => {
37+ compiler . plugin ( 'compilation' , ( compilation : any ) => {
38+ compilation . plugin ( 'html-webpack-plugin-after-emit' , ( data : any , cb : any ) => {
4139 if ( cb ) {
4240 cb ( ) ;
4341 }
4442 } ) ;
4543} ) ;
4644
47- Object . keys ( proxyTable ) . forEach ( ( context ) => {
48- let options = proxyTable [ context ] ;
49- if ( typeof options === 'string' ) {
50- options = { target : options } ;
51- }
52- app . use ( proxyMiddleware ( options . filter || context , options ) ) ;
53- } ) ;
54-
5545app . use ( connectionHistoryApiFallback ( ) ) ;
5646
5747app . use ( devMiddleware ) ;
0 commit comments