diff --git a/packages/bridge/src/transpile.ts b/packages/bridge/src/transpile.ts index b73c90da7e..22f1c634fd 100644 --- a/packages/bridge/src/transpile.ts +++ b/packages/bridge/src/transpile.ts @@ -5,6 +5,8 @@ export const setupTranspile = () => { const nuxt = useNuxt() nuxt.hook('modules:done', () => { - addModuleTranspiles() + addModuleTranspiles({ + additionalModules: ['@nuxt/bridge-edge'] + }) }) } diff --git a/packages/nuxt3/src/core/modules.ts b/packages/nuxt3/src/core/modules.ts index 50358788ea..94f242541e 100644 --- a/packages/nuxt3/src/core/modules.ts +++ b/packages/nuxt3/src/core/modules.ts @@ -1,9 +1,14 @@ import { useNuxt } from '@nuxt/kit' -export const addModuleTranspiles = () => { +export interface AddModuleTranspilesOptions { + additionalModules?: string[] +} + +export const addModuleTranspiles = (opts: AddModuleTranspilesOptions = {}) => { const nuxt = useNuxt() const modules = [ + ...opts.additionalModules || [], ...nuxt.options.buildModules, ...nuxt.options.modules, ...nuxt.options._modules