diff --git a/packages/nuxt/src/core/plugins/plugin-metadata.ts b/packages/nuxt/src/core/plugins/plugin-metadata.ts index e3c31157ce..69ea8069fc 100644 --- a/packages/nuxt/src/core/plugins/plugin-metadata.ts +++ b/packages/nuxt/src/core/plugins/plugin-metadata.ts @@ -44,6 +44,9 @@ export async function extractMetadata (code: string, loader = 'ts' as 'ts' | 'ts if (metaCache[code]) { return metaCache[code] } + if (code.match(/defineNuxtPlugin\s*\([\w(]/)) { + return {} + } const js = await transform(code, { loader }) parseAndWalk(js.code, `file.${loader}`, (node) => { if (node.type !== 'CallExpression' || node.callee.type !== 'Identifier') { return }