Skip to content

Commit

Permalink
Support bootstrapping without NPM paths (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
lauckhart authored Oct 21, 2023
1 parent 834f63e commit 4bd17ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/src/util/bootstrap.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { dirname, resolve } from "path";
import { fileURLToPath } from "url";
import { spawn } from "child_process";
import { platform } from "os";
import { stat } from "fs/promises";

const toolRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../..");

Expand All @@ -26,9 +27,14 @@ if (platform() === "win32") {
options.shell = true;
}

let esbuild = resolve(toolRoot, "../node_modules/.bin/esbuild");
if (!await stat(esbuild)) {
esbuild = "esbuild";
}

await new Promise((resolve) => {
const proc = spawn(
"esbuild",
esbuild,
[
"src/**/*.ts",
"--outdir=dist/esm",
Expand Down

0 comments on commit 4bd17ea

Please sign in to comment.