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

Commit

Permalink
fix: try normalizing specifier
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jul 8, 2022
1 parent e45a67d commit a6027e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/pages/macros.ts
Expand Up @@ -48,7 +48,7 @@ export const TransformMacroPlugin = createUnplugin((options: TransformMacroPlugi
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 parsed = parseURL(decodeURIComponent(pathToFileURL(scriptImport.specifier.replace('?macro=true', '')).href))
const specifier = withQuery(parsed.pathname, { macro: 'true', ...parseQuery(parsed.search) })
s.overwrite(0, code.length, `export { meta } from "${specifier}"`)
return result()
Expand Down

0 comments on commit a6027e2

Please sign in to comment.