diff --git a/packages/nuxt3/src/auto-imports/transform.ts b/packages/nuxt3/src/auto-imports/transform.ts index 7b92a1aac3..b2c796b3d7 100644 --- a/packages/nuxt3/src/auto-imports/transform.ts +++ b/packages/nuxt3/src/auto-imports/transform.ts @@ -30,14 +30,17 @@ export const TransformPlugin = createUnplugin((map: IdentifierMap) => { enforce: 'post', transformInclude (id) { const { pathname, search } = parseURL(id) - const query = parseQuery(search) + const { type } = parseQuery(search) if (id.includes('node_modules')) { return false } // vue files - if (pathname.endsWith('.vue') && (query.type === 'template' || !search)) { + if ( + pathname.endsWith('.vue') && + (type === 'template' || type === 'script' || !search) + ) { return true }