A minimal example of statically serving DuckDB-WASM with all dependencies stored and served locally.
Download all dependencies by running:
./download-dependencies.sh├── index.html # Main HTML file with DuckDB example
├── download-dependencies.sh # Script to download all dependencies
└── dist/
├── duckdb-browser.mjs # DuckDB browser module
├── duckdb-mvp.wasm # MVP bundle (broader compatibility)
├── duckdb-browser-mvp.worker.js # MVP worker
├── duckdb-eh.wasm # EH bundle (exception handling)
├── duckdb-browser-eh.worker.js # EH worker
├── apache-arrow.mjs # Apache Arrow dependency
├── flatbuffers.mjs # FlatBuffers dependency
└── tslib.mjs # TypeScript helpers
Due to CORS restrictions, you need to serve the files via a local web server:
# Using Python
python3 -m http.server 8080
# Using Node.js (npx)
PORT=8080 npx serve .
# Using PHP
php -S localhost:8080Then open http://localhost:8080 in your browser.