Skip to content

Commit

Permalink
🐛 Unable to resolve export
Browse files Browse the repository at this point in the history
  • Loading branch information
takker99 committed Nov 11, 2021
1 parent e0f5bd1 commit 676377c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions build.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ self.addEventListener<"message">("message", async (event) => {
const { response } = await fetch(entryURL);
const loader = getLoader(response);
const url = decodeURI(entryURL);
const { host, pathname } = new URL(url);
const sourcefile = pathname.split("/").pop();
const resolveDir = `${host}/${pathname.split("/").slice(0, -1).join("/")}`;
// const { pathname } = new URL(url);
// const sourcefile = pathname.split("/").pop();

const result = await build({
stdin: {
contents: loader === "css" ? `@import "${url}";` : `import "${url}";`,
contents: await response.text(),
loader,
sourcefile,
resolveDir,
},
write: false,
...options,
Expand Down
1 change: 1 addition & 0 deletions loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const remoteLoader = (
namespace: name,
};
}
importer = importer === "<stdin>" ? baseURL.toString() : importer;
const importURL = new URL(resolvedPath, importer).toString();
if (skip(path)) return { external: true };
if (importURL.startsWith("http")) {
Expand Down

0 comments on commit 676377c

Please sign in to comment.