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: {
316316 return false ;
317317} ;
318318
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+
319333type ServerCallbacks = {
320334 onInvalid : ( ) => void ;
321335 onDone : ( stats : any ) => void ;
@@ -334,7 +348,8 @@ export const setupServerHooks = (
334348 } ,
335349 hookCallbacks : ServerCallbacks ,
336350) => {
337- if ( ! isClientCompiler ( compiler ) ) {
351+ // TODO: node ssr HMR is not supported yet
352+ if ( isNodeCompiler ( compiler ) ) {
338353 return ;
339354 }
340355
You can’t perform that action at this time.
0 commit comments