Skip to content

Commit a3d3176

Browse files
anandgupta42claude
andauthored
fix: mark driver packages as external in build to prevent 4x binary bloat (#246)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e4f3471 commit a3d3176

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

packages/opencode/script/build.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ for (const item of targets) {
199199
tsconfig: "./tsconfig.json",
200200
plugins: [solidPlugin],
201201
sourcemap: "external",
202+
// Database drivers are loaded lazily at runtime via dynamic import().
203+
// They must NOT be bundled into the binary — users install them on demand.
204+
external: [
205+
"pg", "snowflake-sdk", "@google-cloud/bigquery", "@databricks/sql",
206+
"mysql2", "mssql", "oracledb", "duckdb", "better-sqlite3",
207+
"keytar", "ssh2", "dockerode",
208+
],
202209
compile: {
203210
autoloadBunfig: false,
204211
autoloadDotenv: false,

0 commit comments

Comments
 (0)