File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,20 @@ export const isClientCompiler = (compiler: {
316
316
return false ;
317
317
} ;
318
318
319
+ const isNodeCompiler = ( compiler : {
320
+ options : {
321
+ target ?: Compiler [ 'options' ] [ 'target' ] ;
322
+ } ;
323
+ } ) => {
324
+ const { target } = compiler . options ;
325
+
326
+ if ( target ) {
327
+ return Array . isArray ( target ) ? target . includes ( 'node' ) : target === 'node' ;
328
+ }
329
+
330
+ return false ;
331
+ } ;
332
+
319
333
type ServerCallbacks = {
320
334
onInvalid : ( ) => void ;
321
335
onDone : ( stats : any ) => void ;
@@ -334,7 +348,8 @@ export const setupServerHooks = (
334
348
} ,
335
349
hookCallbacks : ServerCallbacks ,
336
350
) => {
337
- if ( ! isClientCompiler ( compiler ) ) {
351
+ // TODO: node ssr HMR is not supported yet
352
+ if ( isNodeCompiler ( compiler ) ) {
338
353
return ;
339
354
}
340
355
You can’t perform that action at this time.
0 commit comments