fix(nuxt3): parse macro queries for components (#4121)

This commit is contained in:
Daniel Roe 2022-04-06 11:05:37 +01:00 committed by GitHub
parent e561efc6c8
commit da46b8d165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => ({
const query = parseQuery(search)
// we only transform render functions
// from `type=template` (in Webpack) and bare `.vue` file (in Vite)
return pathname.endsWith('.vue') && (query.type === 'template' || !search)
return pathname.endsWith('.vue') && (query.type === 'template' || !!query.macro || !search)
},
transform (code, id) {
return transform(code, id, options.getComponents())