Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/build-bundles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import { execFileSync, spawnSync } from "node:child_process";
import { chmodSync, readFileSync } from "node:fs";
import { createRequire } from "node:module";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";

const require = createRequire(import.meta.url);
const { computeCodeHash } = require("./code-hash.cjs");

const repoRoot = resolve(new URL("..", import.meta.url).pathname);
// fileURLToPath, not URL.pathname (issue #240): on win32 pathname yields
// "/C:/..." and resolve() then doubles the drive into "C:\C:\...", so every
// build target dies on ENOENT reading package.json.
const repoRoot = resolve(fileURLToPath(new URL("..", import.meta.url)));
const pkg = JSON.parse(readFileSync(resolve(repoRoot, "package.json"), "utf-8"));

/**
Expand Down
Loading