Skip to content

Commit 4ed3c0e

Browse files
committed
Generate esbuild metadata file
1 parent 191d7c6 commit 4ed3c0e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ build/
1111
eslint.sarif
1212
# for local incremental compilation
1313
tsconfig.tsbuildinfo
14+
# esbuild metadata file
15+
meta.json

build.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { copyFile, rm } from "node:fs/promises";
1+
import { copyFile, rm, writeFile } from "node:fs/promises";
22
import { dirname, join } from "node:path";
33
import { fileURLToPath } from "node:url";
44

@@ -74,7 +74,10 @@ const context = await esbuild.context({
7474
define: {
7575
__CODEQL_ACTION_VERSION__: JSON.stringify(pkg.version),
7676
},
77+
metafile: true,
7778
});
7879

79-
await context.rebuild();
80+
const result = await context.rebuild();
81+
await writeFile("meta.json", JSON.stringify(result.metafile));
82+
8083
await context.dispose();

0 commit comments

Comments
 (0)