@@ -1973,15 +1973,29 @@ class Server {
1973
1973
1974
1974
let isOutputModule = false ;
1975
1975
1976
- this . stats . compilation . assetsInfo . forEach ( ( value , key ) => {
1977
- const assetExtension = path . extname ( key ) ;
1978
- const assetBasename = path . basename ( key , assetExtension ) ;
1976
+ if ( typeof this . compiler . compilers !== "undefined" ) {
1977
+ this . stats . stats . forEach ( ( stats ) => {
1978
+ stats . compilation . assetsInfo . forEach ( ( value , key ) => {
1979
+ const assetExtension = path . extname ( key ) ;
1980
+ const assetBasename = path . basename ( key , assetExtension ) ;
1981
+
1982
+ if ( assetBasename === outputFilename ) {
1983
+ extension = assetExtension ;
1984
+ isOutputModule = value . javascriptModule ;
1985
+ }
1986
+ } ) ;
1987
+ } ) ;
1988
+ } else {
1989
+ this . stats . compilation . assetsInfo . forEach ( ( value , key ) => {
1990
+ const assetExtension = path . extname ( key ) ;
1991
+ const assetBasename = path . basename ( key , assetExtension ) ;
1979
1992
1980
- if ( assetBasename === outputFilename ) {
1981
- extension = assetExtension ;
1982
- isOutputModule = value . javascriptModule ;
1983
- }
1984
- } ) ;
1993
+ if ( assetBasename === outputFilename ) {
1994
+ extension = assetExtension ;
1995
+ isOutputModule = value . javascriptModule ;
1996
+ }
1997
+ } ) ;
1998
+ }
1985
1999
1986
2000
if ( isOutputModule ) {
1987
2001
filename = this . middleware . getFilenameFromUrl ( `${ _path } ${ extension } ` ) ;
@@ -2006,6 +2020,7 @@ class Server {
2006
2020
2007
2021
res . send ( responsePage ) ;
2008
2022
} catch ( error ) {
2023
+ console . log ( error ) ;
2009
2024
return next ( ) ;
2010
2025
}
2011
2026
} ) ;
0 commit comments