Skip to content

Commit

Permalink
feat(app): Use vue-i18n's feature flags #8448
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Feb 9, 2021
1 parent 47323d7 commit da864c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/lib/quasar-conf-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions app/lib/webpack/create-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit da864c4

Please sign in to comment.