Skip to content

Commit b7944f2

Browse files
committed
Fix multiple paths for parcel
1 parent f056207 commit b7944f2

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ self.addEventListener('message', async event => {
122122
if (node.tag === 'a' && node.attrs[attr].lastIndexOf('.') < 1) {
123123
continue;
124124
}
125+
126+
if (
127+
node.tag === 'html' &&
128+
node.attrs[attr].endsWith('.html') &&
129+
attr === 'href'
130+
) {
131+
// Another HTML file, we'll compile it when the user goes to it
132+
continue;
133+
}
134+
125135
if (elements && elements.includes(node.tag)) {
126136
const result = addDependency(node.attrs[attr]);
127137

packages/common/templates/parcel.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ class ParcelTemplate extends Template {
1010
getEntries(configurationFiles: { [type: string]: Object }) {
1111
const entries = [];
1212

13+
if (typeof document !== 'undefined') {
14+
// Push the location of the address bar, eg. when someone has a file
15+
// /2.html open, you actually want to have that as entry point instead
16+
// of index.html.
17+
entries.push(document.location.pathname);
18+
}
19+
1320
entries.push(
1421
configurationFiles.package &&
1522
configurationFiles.package.parsed &&

0 commit comments

Comments
 (0)