Skip to content

Commit 5439bc5

Browse files
author
Ives van Hoorne
committed
Fix relative path resolving
1 parent 9fa4e98 commit 5439bc5

File tree

1 file changed

+5
-1
lines changed
  • packages/app/src/sandbox/eval/presets/parcel/transpilers

1 file changed

+5
-1
lines changed

packages/app/src/sandbox/eval/presets/parcel/transpilers/html-worker.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ self.addEventListener('message', async event => {
6464

6565
function addDependency(depPath: string) {
6666
if (!isUrl(depPath)) {
67-
const assetPath = decodeURIComponent(depPath);
67+
let assetPath = decodeURIComponent(depPath);
68+
if (/^\w/.test(assetPath)) {
69+
assetPath = `./${assetPath}`;
70+
}
71+
6872
self.postMessage({
6973
type: 'add-dependency',
7074
path: assetPath,

0 commit comments

Comments
 (0)