Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(kit): add manually installed module to transpile #9187

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/kit/src/module/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export async function installModule (moduleToInstall: string | NuxtModule, _inli

if (typeof moduleToInstall === 'string') {
nuxt.options.build.transpile.push(moduleToInstall)
} else if (moduleToInstall.getMeta) {
const meta = await moduleToInstall.getMeta()
if (meta.name) {
nuxt.options.build.transpile.push(meta.name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dangerous and error prune. Name of module can be integration/library name not npm package of nuxt modue itself.

}
}

nuxt.options._installedModules = nuxt.options._installedModules || []
Expand Down