Generate esbuild metadata file

This commit is contained in:
Michael B. Gale
2026-03-27 17:53:16 +00:00
parent 191d7c6f13
commit 4ed3c0efe6
2 changed files with 7 additions and 2 deletions

2
.gitignore vendored
View File

@@ -11,3 +11,5 @@ build/
eslint.sarif
# for local incremental compilation
tsconfig.tsbuildinfo
# esbuild metadata file
meta.json

View File

@@ -1,4 +1,4 @@
import { copyFile, rm } from "node:fs/promises";
import { copyFile, rm, writeFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
@@ -74,7 +74,10 @@ const context = await esbuild.context({
define: {
__CODEQL_ACTION_VERSION__: JSON.stringify(pkg.version),
},
metafile: true,
});
await context.rebuild();
const result = await context.rebuild();
await writeFile("meta.json", JSON.stringify(result.metafile));
await context.dispose();