fix(bridge): transpile @nuxt/bridge-edge (#4070)

This commit is contained in:
Daniel Roe 2022-04-05 11:41:45 +01:00 committed by GitHub
parent 9f6eff7511
commit f39fd9f0a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,8 @@ export const setupTranspile = () => {
const nuxt = useNuxt()
nuxt.hook('modules:done', () => {
addModuleTranspiles()
addModuleTranspiles({
additionalModules: ['@nuxt/bridge-edge']
})
})
}

View File

@ -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