From c6fb5180354c8a9bf07ae1b4c22d551cb2855f95 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Wed, 22 May 2024 20:41:01 -0400 Subject: [PATCH] document handling query params for theme pack plugin local dev (#1228) --- www/pages/guides/theme-packs.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/pages/guides/theme-packs.md b/www/pages/guides/theme-packs.md index 78cf4f2e6..18c475995 100644 --- a/www/pages/guides/theme-packs.md +++ b/www/pages/guides/theme-packs.md @@ -170,8 +170,11 @@ class MyThemePackDevelopmentResource extends ResourceInterface { async resolve(url) { const { userWorkspace } = this.compilation.context; const filePath = this.getBareUrlPath(url).split(`/node_modules/${packageName}/dist/`)[1]; + const params = searchParams.size > 0 + ? `?${searchParams.toString()}` + : ''; - return new URL(`./${filePath}`, userWorkspace, filePath); + return new URL(`./${filePath}${params}`, userWorkspace, filePath); } }