Skip to content

Commit

Permalink
feat(vite query-params): prevent vite QP to be passed to core logic -…
Browse files Browse the repository at this point in the history
…> when asking for a virtual content
  • Loading branch information
BlueCutOfficial committed Mar 21, 2024
1 parent 8309b88 commit 7b2ea00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/vite/src/resolver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Plugin, ViteDevServer } from 'vite';
import { virtualContent, ResolverLoader } from '@embroider/core';
import { cleanUrlQueryParams, virtualContent, ResolverLoader } from '@embroider/core';
import { RollupModuleRequest, virtualPrefix } from './request';
import assertNever from 'assert-never';
import makeDebug from 'debug';
Expand Down Expand Up @@ -52,7 +52,10 @@ export function resolver(): Plugin {
},
load(id) {
if (id.startsWith(virtualPrefix)) {
let { src, watches } = virtualContent(id.slice(virtualPrefix.length), resolverLoader.resolver);
let { src, watches } = virtualContent(
cleanUrlQueryParams(id.slice(virtualPrefix.length)),
resolverLoader.resolver
);
virtualDeps.set(id, watches);
server?.watcher.add(watches);
return src;
Expand Down

0 comments on commit 7b2ea00

Please sign in to comment.