mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(bridge): do not resolve esm babel helpers (#1158)
This commit is contained in:
parent
870a62855c
commit
adf497046b
@ -9,9 +9,6 @@ export function setupAppBridge (_options: any) {
|
||||
nuxt.options.alias['#app'] = resolve(distDir, 'runtime/index.mjs')
|
||||
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
|
||||
nuxt.options.alias['#vue'] = nuxt.options.alias.vue || resolveModule('vue/dist/vue.runtime.esm.js', { paths: nuxt.options.modulesDir })
|
||||
for (const alias of [
|
||||
|
@ -43,6 +43,10 @@ class EnhancedResolverPlugin {
|
||||
// Fall back to default webpack4 resolver if not a node_modules import
|
||||
if (!id || !defaultResolver.isModule(id)) { return }
|
||||
|
||||
// Fall back to webpack4 resolver if resolving babel helpers
|
||||
// https://github.com/nuxt/nuxt.js/blob/714249740690569eedf74aa7bca7ed31c01953d4/packages/babel-preset-app/src/index.js#L169
|
||||
if (id.includes('/@babel/')) { return }
|
||||
|
||||
const importer = request.context?.issuer
|
||||
try {
|
||||
const result = await enhancedResolver.resolve(id, importer)
|
||||
|
Loading…
Reference in New Issue
Block a user