Skip to content

Commit 7fc54a3

Browse files
committed
chore: update esbuild config to write meta data only non-production
1 parent 5aaab74 commit 7fc54a3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

infra/compiler/src/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ if (entryPoints.length < 1) {
6060
throw new Error(`No export module found to build at: ${absWorkingDir}`)
6161
}
6262

63+
const outdir = path.resolve(absWorkingDir, 'dist')
64+
6365
const ctx = await context({
6466
sourceRoot: absWorkingDir,
6567
entryPoints,
@@ -69,10 +71,11 @@ const ctx = await context({
6971
sourcemap: !options.production,
7072
sourcesContent: false,
7173
platform: 'node',
72-
outdir: path.resolve(absWorkingDir, 'dist'),
74+
outdir,
7375
outExtension: { '.js': '.cjs' },
7476
external: ['vscode'],
7577
logLevel: 'silent',
78+
metafile: true,
7679
plugins: [
7780
/* add to the end of plugins array */
7881
esbuildProblemMatcherPlugin,
@@ -81,6 +84,10 @@ const ctx = await context({
8184
if (options.watch) {
8285
await ctx.watch()
8386
} else {
84-
await ctx.rebuild()
87+
const result = await ctx.rebuild()
8588
await ctx.dispose()
89+
90+
if (!options.production) {
91+
fss.writeFileSync(path.join(outdir, 'meta.json'), JSON.stringify(result.metafile))
92+
}
8693
}

0 commit comments

Comments
 (0)