Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ describe('resolveBundleDir', () => {
const out = resolveBundleDir('/tmp/x/');
expect(out).toBe('/tmp/x');
});

it('preserves the filesystem root path', () => {
expect(resolveBundleDir('/')).toBe('/');
});
});

describe('streamUrlToFile retry', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export function resolveBundleDir(rawPath: string): string {
},
});
}
const trimmed = rawPath.endsWith('/') ? rawPath.slice(0, -1) : rawPath;
const trimmed = rawPath.endsWith('/') && rawPath.length > 1 ? rawPath.slice(0, -1) : rawPath;
return isAbsolute(trimmed) ? trimmed : resolve(process.cwd(), trimmed);
}

Expand Down
Loading