From c1a68012caaea5929918f6f6a177901ae32d9f78 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 19 Jan 2022 18:11:31 +0000 Subject: [PATCH] fix(nuxt3): add macro transform to non-sfcs (#2804) --- packages/nuxt3/src/pages/macros.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt3/src/pages/macros.ts b/packages/nuxt3/src/pages/macros.ts index 14e2676ca1..a65e8e6d82 100644 --- a/packages/nuxt3/src/pages/macros.ts +++ b/packages/nuxt3/src/pages/macros.ts @@ -12,8 +12,8 @@ export const TransformMacroPlugin = createUnplugin((options: TransformMacroPlugi name: 'nuxt-pages-macros-transform', enforce: 'post', transformInclude (id) { - // We only process SFC files for macros - return parseURL(id).pathname.endsWith('.vue') + const { search, pathname } = parseURL(id) + return pathname.endsWith('.vue') || parseQuery(search).macro }, transform (code, id) { const { search } = parseURL(id)