File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -210,8 +210,8 @@ exports.run = function (options) {
210
210
// hot reload
211
211
if ( hot ) {
212
212
// 修改 publicPath 为当前服务
213
+ var localPublicPath = wpConfig . output . local . publicPath ;
213
214
if ( project . config . replacingPublicPath !== false ) {
214
- var localPublicPath = wpConfig . output . local . publicPath ;
215
215
var hostReg = / ( h t t p : | h t t p s : ) ? ( \/ \/ ) ( [ ^ \/ ] + ) / i;
216
216
if ( localPublicPath && localPublicPath . match ( hostReg ) . length === 4 ) {
217
217
localPublicPath = '/' + UtilPath . normalize ( localPublicPath , false ) ;
@@ -237,7 +237,7 @@ exports.run = function (options) {
237
237
var entryItem = wpConfig . entry [ key ] ;
238
238
if ( sysPath . extname ( entryItem [ entryItem . length - 1 ] ) === '.js' ) {
239
239
var whmPath = require . resolve ( 'webpack-hot-middleware/client' ) ;
240
- entryItem . unshift ( whmPath + '?reload=true' ) ;
240
+ entryItem . unshift ( whmPath + '?reload=true&path=' + localPublicPath + '__webpack_hmr ') ;
241
241
}
242
242
return entryItem ;
243
243
} ) ;
Original file line number Diff line number Diff line change @@ -206,8 +206,8 @@ exports.run = (options) => {
206
206
// hot reload
207
207
if ( hot ) {
208
208
// 修改 publicPath 为当前服务
209
+ let localPublicPath = wpConfig . output . local . publicPath ;
209
210
if ( project . config . replacingPublicPath !== false ) {
210
- let localPublicPath = wpConfig . output . local . publicPath ;
211
211
const hostReg = / ( h t t p : | h t t p s : ) ? ( \/ \/ ) ( [ ^ \/ ] + ) / i;
212
212
if ( localPublicPath && localPublicPath . match ( hostReg ) . length === 4 ) {
213
213
localPublicPath = '/' + UtilPath . normalize ( localPublicPath , false ) ;
@@ -233,7 +233,7 @@ exports.run = (options) => {
233
233
let entryItem = wpConfig . entry [ key ] ;
234
234
if ( sysPath . extname ( entryItem [ entryItem . length - 1 ] ) === '.js' ) {
235
235
const whmPath = require . resolve ( 'webpack-hot-middleware/client' ) ;
236
- entryItem . unshift ( whmPath + '?reload=true' ) ;
236
+ entryItem . unshift ( whmPath + '?reload=true&path=' + localPublicPath + '__webpack_hmr ' ) ;
237
237
}
238
238
return entryItem ;
239
239
} ) ;
You can’t perform that action at this time.
0 commit comments