Skip to content

Commit

Permalink
fix(timeline): do not inject for macro module, close #507
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Nov 11, 2023
1 parent a48c248 commit 923edaf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/devtools/src/integrations/timeline.ts
Expand Up @@ -40,7 +40,9 @@ export async function setup({ nuxt, options }: NuxtDevtoolsServerContext) {

ctx.addons.push(
{
injectImportsResolved(imports) {
injectImportsResolved(imports, _code, id) {
if (id?.includes('?macro=true'))
return
return imports.map((i) => {
if (!filter(i))
return i
Expand All @@ -56,7 +58,9 @@ export async function setup({ nuxt, options }: NuxtDevtoolsServerContext) {
}
})
},
injectImportsStringified(str, imports, s) {
injectImportsStringified(str, imports, s, id) {
if (id?.includes('?macro=true'))
return
const code = s.toString()
const injected = imports.filter(i => i.meta?.wrapperOriginalAs)
if (injected.length) {
Expand Down

0 comments on commit 923edaf

Please sign in to comment.