diff --git a/packages/bridge/src/app.ts b/packages/bridge/src/app.ts index 41204ce047..1761031cd8 100644 --- a/packages/bridge/src/app.ts +++ b/packages/bridge/src/app.ts @@ -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 [ diff --git a/packages/bridge/src/resolve.ts b/packages/bridge/src/resolve.ts index 47b483aa84..a630757366 100644 --- a/packages/bridge/src/resolve.ts +++ b/packages/bridge/src/resolve.ts @@ -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)