Skip to content

Commit

Permalink
fix: vite plugin ignore version query (#151) (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fl0pZz committed Apr 10, 2022
1 parent 9291e41 commit d2f6840
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ export function partytownVite(opts: PartytownViteOptions) {
server.middlewares.use(
async (req: IncomingMessage, res: ServerResponse, next: () => void) => {
try {
const pathname = req.url;
if (pathname && pathname.includes('partytown')) {
const url = req.url ?? ''
// drop query
const [pathname] = url.split('?');
if (pathname.includes('partytown')) {
const fileName = pathname.split('/').pop();
if (fileName && fileName.endsWith('.js')) {
const libDir = libDirPath({ debugDir: pathname.includes('/debug/') });
Expand Down

1 comment on commit d2f6840

@vercel
Copy link

@vercel vercel bot commented on d2f6840 Apr 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.