You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an option to load DuckDB WASM files from jsDelivr CDN instead of bundling them into the build output. This would be controlled by an environment variable (e.g., EVIDENCE_DUCKDB_CDN=true), keeping the current bundled behavior as the default.
The @duckdb/duckdb-wasm library already supports CDN loading natively via getJsDelivrBundles() and selectBundle(), so this would leverage existing, officially supported functionality.
What problem would this solve?
When deploying Evidence sites to Cloudflare Pages, the build fails because DuckDB WASM files exceed Cloudflare's 25MB per-file limit. The WASM files bundled from @duckdb/duckdb-wasm are large enough to push deployments over this limit.
Currently, Evidence bundles DuckDB WASM files directly from node_modules via Vite's ?url imports in @evidence-dev/universal-sql. There's no way to configure Evidence to load these files externally, which makes deployment to size-constrained platforms impossible.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Add an option to load DuckDB WASM files from jsDelivr CDN instead of bundling them into the build output. This would be controlled by an environment variable (e.g.,
EVIDENCE_DUCKDB_CDN=true), keeping the current bundled behavior as the default.The
@duckdb/duckdb-wasmlibrary already supports CDN loading natively viagetJsDelivrBundles()andselectBundle(), so this would leverage existing, officially supported functionality.What problem would this solve?
When deploying Evidence sites to Cloudflare Pages, the build fails because DuckDB WASM files exceed Cloudflare's 25MB per-file limit. The WASM files bundled from
@duckdb/duckdb-wasmare large enough to push deployments over this limit.Currently, Evidence bundles DuckDB WASM files directly from
node_modulesvia Vite's?urlimports in@evidence-dev/universal-sql. There's no way to configure Evidence to load these files externally, which makes deployment to size-constrained platforms impossible.References:
How should it work?
Set an environment variable to enable CDN loading:
Under the hood, this would change packages/lib/universal-sql/src/client-duckdb/browser.js from the current bundled approach:
To use the library's built-in CDN support:
This keeps the default behavior unchanged while giving users an opt-in path for size-constrained deployments.
Beta Was this translation helpful? Give feedback.
All reactions