Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Update packages/nuxt/src/pages/macros.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 12, 2022
1 parent 331d499 commit 4f4addc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/nuxt/src/pages/macros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const TransformMacroPlugin = createUnplugin((options: TransformMacroPlugi
// with workaround for vue-loader bug: https://github.com/vuejs/vue-loader/pull/1911
const scriptImport = findStaticImports(code).find(i => parseQuery(i.specifier.replace('?macro=true', '')).type === 'script')
if (scriptImport) {
// https://github.com/vuejs/vue-loader/pull/1911
// https://github.com/vitejs/vite/issues/8473
const parsed = parseURL(scriptImport.specifier.replace('?macro=true', ''))
const specifier = withQuery(parsed.pathname, { macro: 'true', ...parseQuery(parsed.search) })
s.overwrite(0, code.length, `export { meta } from "${specifier}"`)
Expand Down

0 comments on commit 4f4addc

Please sign in to comment.