Skip to content

Commit

Permalink
fix(dev): retain @ in qrl segments
Browse files Browse the repository at this point in the history
This way the generated imports by vite and the generated qrl segments are in the same path in devtools
  • Loading branch information
wmertens committed Jul 9, 2024
1 parent 574cc3b commit b115d82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions packages/qwik-city/buildtime/vite/dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,7 @@ function skipRequest(pathname: string) {
if (pathname.includes('favicon')) {
return true;
}
if (
pathname.startsWith('/src/') ||
pathname.startsWith('/@fs/') ||
pathname.startsWith('/%40fs/')
) {
if (pathname.startsWith('/src/') || pathname.startsWith('/@fs/')) {
const ext = getExtension(pathname);
if (SKIP_SRC_EXTS[ext]) {
return true;
Expand Down
1 change: 0 additions & 1 deletion packages/qwik/src/optimizer/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
from: importerId,
for: isSSR ? 'server' : 'client',
});
// note that qrl segments request /%40fs instead of /@fs
if (id.startsWith('\0')) {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/qwik/src/optimizer/src/plugins/vite-dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ function getOrigin(req: IncomingMessage) {
}

// We must encode the chunk so that e.g. + doesn't get converted to space etc
const encode = (url: string) => encodeURIComponent(url).replaceAll('%2F', '/');
const encode = (url: string) =>
encodeURIComponent(url).replaceAll('%2F', '/').replaceAll('%40', '@');

function createSymbolMapper(
base: string,
Expand Down

0 comments on commit b115d82

Please sign in to comment.