fix(cli): bundle ink worker-entry.js (#27249)

This commit is contained in:
Ramón Medrano Llamas
2026-05-19 18:47:36 +02:00
committed by GitHub
parent 3494fda2cf
commit 96a8d1d069

View File

@@ -107,6 +107,24 @@ const cliConfig = {
metafile: true,
};
const workerConfig = {
...baseConfig,
entryPoints: {
'worker/worker-entry': path.join(
path.dirname(require.resolve('ink')),
'worker/worker-entry.js',
),
},
outdir: 'bundle',
define: {
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV || 'production',
),
},
plugins: createWasmPlugins(),
alias: commonAliases,
};
const a2aServerConfig = {
...baseConfig,
banner: {
@@ -133,13 +151,18 @@ Promise.allSettled([
writeFileSync('./bundle/esbuild.json', JSON.stringify(metafile, null, 2));
}
}),
esbuild.build(workerConfig),
esbuild.build(a2aServerConfig),
]).then((results) => {
const [cliResult, a2aResult] = results;
const [cliResult, workerResult, a2aResult] = results;
if (cliResult.status === 'rejected') {
console.error('gemini.js build failed:', cliResult.reason);
process.exit(1);
}
if (workerResult.status === 'rejected') {
console.error('worker-entry.js build failed:', workerResult.reason);
process.exit(1);
}
// error in a2a-server bundling will not stop gemini.js bundling process
if (a2aResult.status === 'rejected') {
console.warn('a2a-server build failed:', a2aResult.reason);