File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export const bundle: NuxtBuilder['bundle'] = async (nuxt) => {
66
66
const compiler = webpack ( config )
67
67
68
68
// In dev, write files in memory FS
69
- if ( nuxt . options . dev ) {
69
+ if ( nuxt . options . dev && compiler ) {
70
70
compiler . outputFileSystem = mfs ! as unknown as Compiler [ 'outputFileSystem' ]
71
71
}
72
72
@@ -75,18 +75,20 @@ export const bundle: NuxtBuilder['bundle'] = async (nuxt) => {
75
75
76
76
nuxt . hook ( 'close' , async ( ) => {
77
77
for ( const compiler of compilers ) {
78
- await new Promise ( resolve => compiler . close ( resolve ) )
78
+ await new Promise ( resolve => compiler ? .close ( resolve ) )
79
79
}
80
80
} )
81
81
82
82
// Start Builds
83
83
if ( nuxt . options . dev ) {
84
- await Promise . all ( compilers . map ( c => compile ( c ) ) )
84
+ await Promise . all ( compilers . map ( c => c && compile ( c ) ) )
85
85
return
86
86
}
87
87
88
88
for ( const c of compilers ) {
89
- await compile ( c )
89
+ if ( c ) {
90
+ await compile ( c )
91
+ }
90
92
}
91
93
}
92
94
You can’t perform that action at this time.
0 commit comments