fix(bridge): add vuex alias (#1026)

This commit is contained in:
Daniel Roe 2021-10-14 13:11:21 +01:00 committed by GitHub
parent 380fd66f67
commit 4a34c2a75b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,9 @@ export function setupAppBridge (_options: any) {
nuxt.options.alias['#app'] = resolve(distDir, 'runtime/index.mjs') nuxt.options.alias['#app'] = resolve(distDir, 'runtime/index.mjs')
nuxt.options.alias['#build'] = nuxt.options.buildDir nuxt.options.alias['#build'] = nuxt.options.buildDir
// Alias vuex to its esm version, as vuex.mjs currently exports cjs: https://github.com/vuejs/vuex/pull/2073
nuxt.options.alias.vuex = 'vuex/dist/vuex.esm.js'
// Alias vue to a vue3-compat version of vue2 // Alias vue to a vue3-compat version of vue2
nuxt.options.alias['#vue'] = nuxt.options.alias.vue || resolveModule('vue/dist/vue.runtime.esm.js', { paths: nuxt.options.modulesDir }) nuxt.options.alias['#vue'] = nuxt.options.alias.vue || resolveModule('vue/dist/vue.runtime.esm.js', { paths: nuxt.options.modulesDir })
for (const alias of [ for (const alias of [