Skip to content

Commit 18d60bf

Browse files
authored
fix: cannot defined feature flags accessing (#436)
* fix: cannot defined feature flags accessing * updates
1 parent 61f0bf5 commit 18d60bf

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

packages/vue-i18n/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ export { vTDirective, TranslationDirective } from './directive'
7878
export { I18nPluginOptions } from './plugin'
7979
export { VERSION } from './misc'
8080

81+
if (__ESM_BUNDLER__ && !__TEST__) {
82+
initFeatureFlags()
83+
}
84+
8185
// NOTE: experimental !!
8286
if (__DEV__ || __FEATURE_PROD_INTLIFY_DEVTOOLS__) {
8387
const target = getGlobalThis()
8488
target.__INTLIFY__ = true
8589
setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)
8690
}
8791

88-
if (__ESM_BUNDLER__ && !__TEST__) {
89-
initFeatureFlags()
90-
}
91-
92-
if (__DEV__ || __FEATURE_PROD_VUE_DEVTOOLS__) {
92+
if (__DEV__) {
9393
initDev()
9494
}

packages/vue-i18n/src/misc.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ export function initFeatureFlags(): void {
5555
*/
5656
export function initDev(): void {
5757
if (__BROWSER__) {
58-
console.info(
59-
`You are running a development build of vue-i18n.\n` +
60-
`Make sure to use the production build (*.prod.js) when deploying for production.`
61-
)
58+
if (!__ESM_BUNDLER__) {
59+
console.info(
60+
`You are running a development build of vue-i18n.\n` +
61+
`Make sure to use the production build (*.prod.js) when deploying for production.`
62+
)
63+
}
6264
}
6365
}

packages/vue-i18n/src/runtime.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ export { vTDirective, TranslationDirective } from './directive'
7373
export { I18nPluginOptions } from './plugin'
7474
export { VERSION } from './misc'
7575

76+
if (__ESM_BUNDLER__ && !__TEST__) {
77+
initFeatureFlags()
78+
}
79+
7680
// NOTE: experimental !!
7781
if (__DEV__ || __FEATURE_PROD_INTLIFY_DEVTOOLS__) {
7882
const target = getGlobalThis()
7983
target.__INTLIFY__ = true
8084
setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)
8185
}
8286

83-
if (__ESM_BUNDLER__ && !__TEST__) {
84-
initFeatureFlags()
85-
}
86-
87-
if (__DEV__ && __FEATURE_PROD_VUE_DEVTOOLS__) {
87+
if (__DEV__) {
8888
initDev()
8989
}

0 commit comments

Comments
 (0)