mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
fix(bridge): alias direct references to vue files (#847)
This commit is contained in:
parent
0cf6a6fe17
commit
d5127e95ac
@ -11,8 +11,30 @@ export function setupAppBridge (_options: any) {
|
|||||||
|
|
||||||
// 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 })
|
||||||
nuxt.options.alias['@vue/shared'] = 'vue'
|
for (const alias of [
|
||||||
nuxt.options.alias['@vue/reactivity'] = 'vue'
|
// vue 3 helper packages
|
||||||
|
'@vue/shared',
|
||||||
|
'@vue/reactivity',
|
||||||
|
...[
|
||||||
|
// vue 2 dist files
|
||||||
|
'vue/dist/vue.common.dev',
|
||||||
|
'vue/dist/vue.common',
|
||||||
|
'vue/dist/vue.common.prod',
|
||||||
|
'vue/dist/vue.esm.browser',
|
||||||
|
'vue/dist/vue.esm.browser.min',
|
||||||
|
'vue/dist/vue.esm',
|
||||||
|
'vue/dist/vue',
|
||||||
|
'vue/dist/vue.min',
|
||||||
|
'vue/dist/vue.runtime.common.dev',
|
||||||
|
'vue/dist/vue.runtime.common',
|
||||||
|
'vue/dist/vue.runtime.common.prod',
|
||||||
|
'vue/dist/vue.runtime.esm',
|
||||||
|
'vue/dist/vue.runtime',
|
||||||
|
'vue/dist/vue.runtime.min'
|
||||||
|
].flatMap(m => [m, `${m}.js`])
|
||||||
|
]) {
|
||||||
|
nuxt.options.alias[alias] = 'vue'
|
||||||
|
}
|
||||||
nuxt.options.alias.vue = resolve(distDir, 'runtime/vue.mjs')
|
nuxt.options.alias.vue = resolve(distDir, 'runtime/vue.mjs')
|
||||||
nuxt.options.build.transpile.push('vue')
|
nuxt.options.build.transpile.push('vue')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user