From da864c4c2cf348256ddef1c9507cae67a93d52f9 Mon Sep 17 00:00:00 2001 From: Razvan Stoenescu Date: Wed, 10 Feb 2021 01:06:38 +0200 Subject: [PATCH] feat(app): Use vue-i18n's feature flags #8448 --- app/lib/quasar-conf-file.js | 10 +++++++++- app/lib/webpack/create-chain.js | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/lib/quasar-conf-file.js b/app/lib/quasar-conf-file.js index 0f20ae4c95a..75b9f77bf61 100644 --- a/app/lib/quasar-conf-file.js +++ b/app/lib/quasar-conf-file.js @@ -326,15 +326,23 @@ class QuasarConfFile { // make sure these exist cfg.__rootDefines = { + // vue __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: this.ctx.dev === true || this.ctx.debug === true, + // quasar __QUASAR_VERSION__: `'${quasarVersion}'`, __QUASAR_SSR__: this.ctx.mode.ssr === true, __QUASAR_SSR_SERVER__: false, __QUASAR_SSR_CLIENT__: false, - __QUASAR_SSR_PWA__: false + __QUASAR_SSR_PWA__: false, + + // vue-i18n + __VUE_I18N_FULL_INSTALL__: true, + __VUE_I18N_LEGACY_API__: true, + __INTLIFY_PROD_DEVTOOLS__: this.ctx.dev === true || this.ctx.debug === true } + cfg.__needsAppMountHook = false cfg.__vueDevtools = false cfg.supportTS = cfg.supportTS || false diff --git a/app/lib/webpack/create-chain.js b/app/lib/webpack/create-chain.js index 053a27f474b..bd7ef73265b 100644 --- a/app/lib/webpack/create-chain.js +++ b/app/lib/webpack/create-chain.js @@ -108,6 +108,16 @@ module.exports = function (cfg, configName) { chain.resolve.alias.set('vue$', 'vue/dist/' + vueFile) + const vueI18nFile = configName === 'Server' + ? (cfg.ctx.prod ? 'vue-i18n.cjs.prod.js' : 'vue-i18n.cjs.js') + : ( + cfg.build.vueCompiler + ? 'vue-i18n.esm-bundler.js' + : 'vue-18n.runtime.esm-bundler.js' + ) + + chain.resolve.alias.set('vue-i18n$', 'vue-i18n/dist/' + vueI18nFile) + chain.resolveLoader.modules .merge(resolveModules)