File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -272,13 +272,22 @@ exports.run = function (options) {
272
272
if ( ! usingHotServer ) {
273
273
usingHotServer = projectName ;
274
274
if ( ( 0 , _typeof3 . default ) ( wpConfig . entry ) === 'object' ) {
275
+ // 入口统一改成数组类型
276
+ ( 0 , _keys2 . default ) ( wpConfig . entry ) . forEach ( function ( key ) {
277
+ if ( typeof wpConfig . entry [ key ] === 'string' ) {
278
+ wpConfig . entry [ key ] = [ wpConfig . entry [ key ] ] ;
279
+ }
280
+ } ) ;
281
+
275
282
( 0 , _keys2 . default ) ( wpConfig . entry ) . map ( function ( key ) {
276
283
var entryItem = wpConfig . entry [ key ] ;
284
+
277
285
if ( sysPath . extname ( entryItem [ entryItem . length - 1 ] ) === '.js' ) {
278
286
var whmPath = require . resolve ( 'webpack-hot-middleware/client' ) ;
279
287
var hotPath = 'http://127.0.0.1:' + port + '/__webpack_hmr' ;
280
288
entryItem . unshift ( whmPath + '?reload=true&path=' + hotPath + '&timeout=9999999&overlay=false' ) ;
281
289
}
290
+
282
291
return entryItem ;
283
292
} ) ;
284
293
}
Original file line number Diff line number Diff line change @@ -256,13 +256,22 @@ exports.run = (options) => {
256
256
if ( ! usingHotServer ) {
257
257
usingHotServer = projectName ;
258
258
if ( typeof wpConfig . entry === 'object' ) {
259
+ // 入口统一改成数组类型
260
+ Object . keys ( wpConfig . entry ) . forEach ( ( key ) => {
261
+ if ( typeof wpConfig . entry [ key ] === 'string' ) {
262
+ wpConfig . entry [ key ] = [ wpConfig . entry [ key ] ] ;
263
+ }
264
+ } ) ;
265
+
259
266
Object . keys ( wpConfig . entry ) . map ( ( key ) => {
260
267
let entryItem = wpConfig . entry [ key ] ;
268
+
261
269
if ( sysPath . extname ( entryItem [ entryItem . length - 1 ] ) === '.js' ) {
262
270
const whmPath = require . resolve ( 'webpack-hot-middleware/client' ) ;
263
271
const hotPath = `http://127.0.0.1:${ port } /__webpack_hmr` ;
264
272
entryItem . unshift ( whmPath + '?reload=true&path=' + hotPath + '&timeout=9999999&overlay=false' ) ;
265
273
}
274
+
266
275
return entryItem ;
267
276
} ) ;
268
277
}
You can’t perform that action at this time.
0 commit comments