Skip to content

Commit 3c57a61

Browse files
fix(sdk): use same pattern as public path runtime module
1 parent 4ab2cce commit 3c57a61

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/sdk/src/generateSnapshotFromManifest.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export function generateSnapshotFromManifest(
6060
const getPublicPath = (): string => {
6161
if ('publicPath' in manifest.metaData) {
6262
if (manifest.metaData.publicPath === 'auto' && version) {
63-
return new URL(version).origin + '/';
63+
// use same implementation as publicPath auto runtime module implements
64+
return version
65+
.replace(/#.*$/, '')
66+
.replace(/\?.*$/, '')
67+
.replace(/\/[^\/]+$/, '/');
6468
}
6569
return manifest.metaData.publicPath;
6670
} else {

0 commit comments

Comments
 (0)