Skip to content

Commit

Permalink
fix: cannot defined feature flags accessing (#436)
Browse files Browse the repository at this point in the history
* fix: cannot defined feature flags accessing

* updates
  • Loading branch information
kazupon committed Apr 7, 2021
1 parent 61f0bf5 commit 18d60bf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
10 changes: 5 additions & 5 deletions packages/vue-i18n/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ export { vTDirective, TranslationDirective } from './directive'
export { I18nPluginOptions } from './plugin'
export { VERSION } from './misc'

if (__ESM_BUNDLER__ && !__TEST__) {
initFeatureFlags()
}

// NOTE: experimental !!
if (__DEV__ || __FEATURE_PROD_INTLIFY_DEVTOOLS__) {
const target = getGlobalThis()
target.__INTLIFY__ = true
setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)
}

if (__ESM_BUNDLER__ && !__TEST__) {
initFeatureFlags()
}

if (__DEV__ || __FEATURE_PROD_VUE_DEVTOOLS__) {
if (__DEV__) {
initDev()
}
10 changes: 6 additions & 4 deletions packages/vue-i18n/src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ export function initFeatureFlags(): void {
*/
export function initDev(): void {
if (__BROWSER__) {
console.info(
`You are running a development build of vue-i18n.\n` +
`Make sure to use the production build (*.prod.js) when deploying for production.`
)
if (!__ESM_BUNDLER__) {
console.info(
`You are running a development build of vue-i18n.\n` +
`Make sure to use the production build (*.prod.js) when deploying for production.`
)
}
}
}
10 changes: 5 additions & 5 deletions packages/vue-i18n/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ export { vTDirective, TranslationDirective } from './directive'
export { I18nPluginOptions } from './plugin'
export { VERSION } from './misc'

if (__ESM_BUNDLER__ && !__TEST__) {
initFeatureFlags()
}

// NOTE: experimental !!
if (__DEV__ || __FEATURE_PROD_INTLIFY_DEVTOOLS__) {
const target = getGlobalThis()
target.__INTLIFY__ = true
setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)
}

if (__ESM_BUNDLER__ && !__TEST__) {
initFeatureFlags()
}

if (__DEV__ && __FEATURE_PROD_VUE_DEVTOOLS__) {
if (__DEV__) {
initDev()
}

0 comments on commit 18d60bf

Please sign in to comment.