From d9d3868d9e2b8d8c1f27369c0c72e992455553e9 Mon Sep 17 00:00:00 2001 From: Peter Weston <59482636+p-weston@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:24:00 +0000 Subject: [PATCH] Fix build on windows (#1138) * Fix build on windows * More robust fix for paths in windows builds --- build_plugs.ts | 3 ++- build_web.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build_plugs.ts b/build_plugs.ts index 5bfb651a..889bac72 100644 --- a/build_plugs.ts +++ b/build_plugs.ts @@ -3,6 +3,7 @@ import * as esbuild from "esbuild"; import { compileManifests } from "./cmd/compile.ts"; import { builtinPlugNames } from "./plugs/builtin_plugs.ts"; import { parseArgs } from "@std/cli/parse-args"; +import { fileURLToPath } from "node:url"; if (import.meta.main) { const args = parseArgs(Deno.args, { @@ -27,7 +28,7 @@ if (import.meta.main) { debug: args.debug, reload: args.reload, info: args.info, - configPath: new URL("deno.json", import.meta.url).pathname, + configPath: fileURLToPath(new URL("deno.json", import.meta.url)), }, ); esbuild.stop(); diff --git a/build_web.ts b/build_web.ts index 9004b7f2..1603c1d1 100644 --- a/build_web.ts +++ b/build_web.ts @@ -1,4 +1,5 @@ import { copy } from "@std/fs"; +import { fileURLToPath } from "node:url"; import sass from "denosass"; import { bundleFolder } from "./lib/asset_bundle/builder.ts"; @@ -105,7 +106,7 @@ async function buildCopyBundleAssets() { jsxFragment: "Fragment", jsxImportSource: "https://esm.sh/preact@10.23.1", plugins: denoPlugins({ - configPath: new URL("./deno.json", import.meta.url).pathname, + configPath: fileURLToPath(new URL("./deno.json", import.meta.url)), }), });