Skip to content

Commit

Permalink
handle query params for theme pack local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed May 10, 2024
1 parent 3aeb086 commit caaf0d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions greenwood.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ class MyThemePackDevelopmentResource extends ResourceInterface {
}

async resolve(url) {
const { pathname } = url;
const { pathname, searchParams } = url;
const params = searchParams.size > 0
? `?${searchParams.toString()}`
: '';
const { userWorkspace } = this.compilation.context;
const workspaceUrl = pathname.split(`/node_modules/${packageName}/dist/`)[1];

return new Request(new URL(`./${workspaceUrl}`, userWorkspace));
return new Request(new URL(`./${workspaceUrl}${params}`, userWorkspace));
}
}

Expand Down

0 comments on commit caaf0d7

Please sign in to comment.