Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua committed Nov 28, 2023
1 parent 78f46b0 commit 93371bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pre_build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ function parseRelativePath(from: string, to: string): string {

from = path.join(Deno.cwd(), path.dirname(from));
to = path.fromFileUrl(specifier);
const result = path.relative(from, to);
const result = path.relative(from, to).replace(/\\/g, "/");

console.log(from);
console.log(to);
console.log(result);

return JSON.stringify(result);
return result;
}

function getAsyncLoaderText(
Expand All @@ -294,11 +294,11 @@ function getAsyncLoaderText(
const exportNames = getExportNames(bindgenOutput);
const loaderUrl = parseRelativePath(bindingJsFileName, "../loader.ts");

let loaderText = `import { Loader } from ${loaderUrl};\n`;
let loaderText = `import { Loader } from "${loaderUrl}";\n`;

if (useCache) {
const cacheUrl = parseRelativePath(bindingJsFileName, "../cache.ts");
loaderText += `import { cacheToLocalDir } from ${cacheUrl};\n`;
loaderText += `import { cacheToLocalDir } from "${cacheUrl}";\n`;
}

loaderText += `
Expand Down

0 comments on commit 93371bd

Please sign in to comment.