Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 923edaf

Browse files
committed
fix(timeline): do not inject for macro module, close #507
1 parent a48c248 commit 923edaf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/devtools/src/integrations/timeline.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ export async function setup({ nuxt, options }: NuxtDevtoolsServerContext) {
4040

4141
ctx.addons.push(
4242
{
43-
injectImportsResolved(imports) {
43+
injectImportsResolved(imports, _code, id) {
44+
if (id?.includes('?macro=true'))
45+
return
4446
return imports.map((i) => {
4547
if (!filter(i))
4648
return i
@@ -56,7 +58,9 @@ export async function setup({ nuxt, options }: NuxtDevtoolsServerContext) {
5658
}
5759
})
5860
},
59-
injectImportsStringified(str, imports, s) {
61+
injectImportsStringified(str, imports, s, id) {
62+
if (id?.includes('?macro=true'))
63+
return
6064
const code = s.toString()
6165
const injected = imports.filter(i => i.meta?.wrapperOriginalAs)
6266
if (injected.length) {

0 commit comments

Comments
 (0)