diff --git a/esbuild.config.js b/esbuild.config.js index 983ca263c2..8ebe14534b 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -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);