Skip to content

Commit

Permalink
fix(nuxt3): add macro transform to non-sfcs (nuxt#2804)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Jan 19, 2022
1 parent f219f63 commit c1a6801
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/nuxt3/src/pages/macros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c1a6801

Please sign in to comment.