mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 06:31:27 +00:00
fix(nuxt3): add macro transform to non-sfcs (#2804)
This commit is contained in:
parent
f219f635ad
commit
c1a68012ca
@ -12,8 +12,8 @@ export const TransformMacroPlugin = createUnplugin((options: TransformMacroPlugi
|
|||||||
name: 'nuxt-pages-macros-transform',
|
name: 'nuxt-pages-macros-transform',
|
||||||
enforce: 'post',
|
enforce: 'post',
|
||||||
transformInclude (id) {
|
transformInclude (id) {
|
||||||
// We only process SFC files for macros
|
const { search, pathname } = parseURL(id)
|
||||||
return parseURL(id).pathname.endsWith('.vue')
|
return pathname.endsWith('.vue') || parseQuery(search).macro
|
||||||
},
|
},
|
||||||
transform (code, id) {
|
transform (code, id) {
|
||||||
const { search } = parseURL(id)
|
const { search } = parseURL(id)
|
||||||
|
Loading…
Reference in New Issue
Block a user