mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt3): enable auto-imports for sfc script with type (#931)
This commit is contained in:
parent
ff97e2558c
commit
a42458e107
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user