Skip to content

Commit

Permalink
fix: vite plugin should not load for vite cache
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed May 6, 2022
1 parent 9de120e commit 31ddf89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/integration/api.md
Expand Up @@ -32,6 +32,8 @@ export interface PartytownConfig {
logSendBeaconRequests?: boolean;
logSetters?: boolean;
logStackTraces?: boolean;
// (undocumented)
mainWindowAccessors?: string[];
resolveUrl?(url: URL, location: Location): URL | undefined | null;
// (undocumented)
set?: SetHook;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/vite.ts
Expand Up @@ -32,7 +32,7 @@ export function partytownVite(opts: PartytownViteOptions) {
const url = req.url ?? '';
// drop query
const [pathname] = url.split('?');
if (pathname.includes('partytown')) {
if (pathname.includes('partytown') && !pathname.includes('.vite')) {
const fileName = pathname.split('/').pop();
if (fileName && fileName.endsWith('.js')) {
const libDir = libDirPath({ debugDir: pathname.includes('/debug/') });
Expand Down

1 comment on commit 31ddf89

@vercel
Copy link

@vercel vercel bot commented on 31ddf89 May 6, 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.