Skip to content

Commit

Permalink
fix(qwik): handle cypress dev server path (QwikDev#5509)
Browse files Browse the repository at this point in the history
Co-authored-by: gioboa <giorgiob.boa@gmail.com>
  • Loading branch information
2 people authored and petebacondarwin committed Dec 4, 2023
1 parent 5e0249a commit 4005562
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/qwik/src/optimizer/src/plugins/vite-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,14 @@ function invalidPreviewMessage(middlewares: Connect.Server, msg: string) {
});
}

const CYPRESS_DEV_SERVER_PATH = '/__cypress/src';
const FS_PREFIX = `/@fs/`;
const VALID_ID_PREFIX = `/@id/`;
const VITE_PUBLIC_PATH = `/@vite/`;
const internalPrefixes = [FS_PREFIX, VALID_ID_PREFIX, VITE_PUBLIC_PATH];
const InternalPrefixRE = new RegExp(`^(?:${internalPrefixes.join('|')})`);
const InternalPrefixRE = new RegExp(
`^(${CYPRESS_DEV_SERVER_PATH})?(?:${internalPrefixes.join('|')})`
);

const shouldSsrRender = (req: IncomingMessage, url: URL) => {
const pathname = url.pathname;
Expand Down

0 comments on commit 4005562

Please sign in to comment.