From 93371bddf1e7ef14005364654ddd4c373d52f08e Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Wed, 29 Nov 2023 10:22:14 +1100 Subject: [PATCH] x --- lib/pre_build.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pre_build.ts b/lib/pre_build.ts index 4ddc26e..235fc3e 100644 --- a/lib/pre_build.ts +++ b/lib/pre_build.ts @@ -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( @@ -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 += `