Bundler Configuration
GenosDB uses dynamic imports withimport.meta.url for loading optional modules. Some bundlers may require additional configuration to handle this correctly.
Zero Runtime Dependencies
GenosDB publishes a self-contained bundle: the npm package ships only the pre-builtdist/ files, with every build-time library (ethers, pako, @msgpack/msgpack, and the internal GenosRTC module) inlined at build time. Installing GenosDB therefore pulls no transitive npm dependencies:
Note onnpm audit: Tools likenpm auditmay report advisories fordevDependencies(used only to build the project, e.g. the bundler toolchain). These never reach consumers, since they are not part of the publisheddist/and their code is not present in the bundle.
Vite
If using Vite, add the following to yourvite.config.js:
Production builds
exclude only affects the dev server. GenosDB resolves its own modules relative to
itself (import.meta.url), so re-bundling it in a production build can leave those
modules unemitted (404). Keep GenosDB’s dist/ intact in your output — ship it
as a single folder and load GenosDB from that path — and set build.target: 'es2022'
(GenosDB uses top-level await).
Webpack
No additional configuration is typically required for Webpack 5+.esbuild / Bun
Bun Example (bundler.ts)
When usingBun.build, add a step to copy the assets after the build completes: