Fix build on windows (#1138)

* Fix build on windows

* More robust fix for paths in windows builds
pull/1145/head
Peter Weston 2024-11-07 20:24:00 +00:00 committed by GitHub
parent 68ead02975
commit d9d3868d9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import * as esbuild from "esbuild";
import { compileManifests } from "./cmd/compile.ts"; import { compileManifests } from "./cmd/compile.ts";
import { builtinPlugNames } from "./plugs/builtin_plugs.ts"; import { builtinPlugNames } from "./plugs/builtin_plugs.ts";
import { parseArgs } from "@std/cli/parse-args"; import { parseArgs } from "@std/cli/parse-args";
import { fileURLToPath } from "node:url";
if (import.meta.main) { if (import.meta.main) {
const args = parseArgs(Deno.args, { const args = parseArgs(Deno.args, {
@ -27,7 +28,7 @@ if (import.meta.main) {
debug: args.debug, debug: args.debug,
reload: args.reload, reload: args.reload,
info: args.info, info: args.info,
configPath: new URL("deno.json", import.meta.url).pathname, configPath: fileURLToPath(new URL("deno.json", import.meta.url)),
}, },
); );
esbuild.stop(); esbuild.stop();

View File

@ -1,4 +1,5 @@
import { copy } from "@std/fs"; import { copy } from "@std/fs";
import { fileURLToPath } from "node:url";
import sass from "denosass"; import sass from "denosass";
import { bundleFolder } from "./lib/asset_bundle/builder.ts"; import { bundleFolder } from "./lib/asset_bundle/builder.ts";
@ -105,7 +106,7 @@ async function buildCopyBundleAssets() {
jsxFragment: "Fragment", jsxFragment: "Fragment",
jsxImportSource: "https://esm.sh/preact@10.23.1", jsxImportSource: "https://esm.sh/preact@10.23.1",
plugins: denoPlugins({ plugins: denoPlugins({
configPath: new URL("./deno.json", import.meta.url).pathname, configPath: fileURLToPath(new URL("./deno.json", import.meta.url)),
}), }),
}); });