Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Oct 4, 2024
1 parent bf1b4be commit 361c348
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/guides/tutorials/theme-packs.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,17 @@ class MyThemePackDevelopmentResource extends ResourceInterface {
}
async shouldResolve(url) {
return process.env.__GWD_COMMAND__ === 'develop' && url.pathname.indexOf(`/node_modules/${packageName}/`) >= 0;
return (
process.env.__GWD_COMMAND__ === "develop" &&
url.pathname.indexOf(`/node_modules/${packageName}/`) >= 0
);
}
async resolve(url) {
const { userWorkspace } = this.compilation.context;
const { pathname, searchParams } = url;
const workspaceUrl = pathname.split(`/node_modules/${packageName}/dist/`)[1];
const params = searchParams.size > 0 ? `?${searchParams.toString()}` : '';
const params = searchParams.size > 0 ? `?${searchParams.toString()}` : "";
return new Request(new URL(`./${workspaceUrl}${params}`, userWorkspace));
}
Expand Down

0 comments on commit 361c348

Please sign in to comment.