File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,16 +23,16 @@ module.exports = app => {
2323 app . messenger . on ( Constant . EVENT_WEBPACK_BUILD_STATE , data => {
2424 app . WEBPACK_BUILD_READY = data . state ;
2525 const config = app . config . webpack ;
26- const port = data . port ;
26+ const port = data . port || config . port ;
2727 if ( ! app . WEBPACK_BUILD_PROXY && config . proxy ) {
2828 app . WEBPACK_BUILD_PROXY = true ;
2929 if ( typeof config . proxy === 'boolean' ) {
3030 config . proxy = {
3131 host : `http://127.0.0.1:${ port } ` ,
3232 match : / ^ \/ p u b l i c \/ / ,
3333 } ;
34- } else if ( config . proxy . host ) {
35- config . proxy . host = config . proxy . host . replace ( config . port , port ) ;
34+ } else if ( config . proxy . force !== true ) {
35+ config . proxy . host = `http://127.0.0.1: ${ port } ` ;
3636 }
3737 app . middleware . splice ( app . middleware . length - 2 , 0 , convert ( proxy ( config . proxy ) ) ) ;
3838 }
@@ -51,4 +51,4 @@ module.exports = app => {
5151 app . ready ( ( ) => {
5252 app . messenger . sendToAgent ( Constant . EVENT_WEBPACK_BUILD_STATE ) ;
5353 } ) ;
54- } ;
54+ } ;
Original file line number Diff line number Diff line change 11{
22 "name" : " egg-webpack" ,
3- "version" : " 4.5.0 " ,
3+ "version" : " 4.5.1 " ,
44 "description" : " webpack dev server plugin for egg, support read file in memory and hot reload." ,
55 "eggPlugin" : {
66 "name" : " webpack" ,
You can’t perform that action at this time.
0 commit comments