Skip to content

Commit a90f06a

Browse files
committed
Ensure publicUrl ends with a slash in react-static packager
1 parent 9cb4b86 commit a90f06a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/packagers/react-static/src/ReactStaticPackager.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,13 @@ async function loadBundleUncached(
392392

393393
parcelRequire.root = parcelRequire;
394394

395+
let publicUrl = bundle.target.publicUrl;
396+
if (!publicUrl.endsWith('/')) {
397+
publicUrl += '/';
398+
}
395399
parcelRequire.meta = {
396400
distDir: bundle.target.distDir,
397-
publicUrl: bundle.target.publicUrl,
401+
publicUrl,
398402
};
399403

400404
parcelRequire.load = async (filePath: string) => {

0 commit comments

Comments
 (0)