@@ -280,7 +280,7 @@ export function createI18n<
280
280
} ,
281
281
// install plugin
282
282
async install ( app : App , ...options : unknown [ ] ) : Promise < void > {
283
- if ( __DEV__ || __FEATURE_PROD_DEVTOOLS__ ) {
283
+ if ( ( __DEV__ || __FEATURE_PROD_DEVTOOLS__ ) && ! __NODE_JS__ ) {
284
284
app . __VUE_I18N__ = i18n as _I18n
285
285
}
286
286
@@ -313,7 +313,7 @@ export function createI18n<
313
313
)
314
314
}
315
315
316
- if ( __DEV__ ) {
316
+ if ( ( __DEV__ || __FEATURE_PROD_DEVTOOLS__ ) && ! __NODE_JS__ ) {
317
317
const ret = await enableDevTools ( app , i18n as _I18n )
318
318
if ( ! ret ) {
319
319
throw createI18nError ( I18nErrorCodes . CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN )
@@ -366,7 +366,7 @@ export function createI18n<
366
366
}
367
367
}
368
368
369
- if ( __DEV__ || __FEATURE_PROD_DEVTOOLS__ ) {
369
+ if ( ( __DEV__ || __FEATURE_PROD_DEVTOOLS__ ) && ! __NODE_JS__ ) {
370
370
devtoolsRegisterI18n ( i18n , VERSION )
371
371
}
372
372
@@ -582,7 +582,11 @@ function setupLifeCycle<Messages, DateTimeFormats, NumberFormats>(
582
582
583
583
onMounted ( ( ) => {
584
584
// inject composer instance to DOM for intlify-devtools
585
- if ( ( __DEV__ || __FEATURE_PROD_DEVTOOLS__ ) && target . vnode . el ) {
585
+ if (
586
+ ( __DEV__ || __FEATURE_PROD_DEVTOOLS__ ) &&
587
+ ! __NODE_JS__ &&
588
+ target . vnode . el
589
+ ) {
586
590
target . vnode . el . __INTLIFY__ = composer
587
591
emitter = createEmitter < DevToolsEmitterEvents > ( )
588
592
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -596,6 +600,7 @@ function setupLifeCycle<Messages, DateTimeFormats, NumberFormats>(
596
600
// remove composer instance from DOM for intlify-devtools
597
601
if (
598
602
( __DEV__ || __FEATURE_PROD_DEVTOOLS__ ) &&
603
+ ! __NODE_JS__ &&
599
604
target . vnode . el &&
600
605
target . vnode . el . __INTLIFY__
601
606
) {
0 commit comments