Skip to content

Commit 5efdf5f

Browse files
committed
update docs/bundler-configuration.md
1 parent 49579f5 commit 5efdf5f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/bundler-configuration.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Bundler Configuration
2+
3+
GenosDB uses dynamic imports with `import.meta.url` for loading optional modules. Some bundlers may require additional configuration to handle this correctly.
4+
5+
## Vite
6+
7+
If using Vite, add the following to your `vite.config.js`:
8+
9+
```js
10+
import { defineConfig } from 'vite'
11+
12+
export default defineConfig({
13+
optimizeDeps: {
14+
exclude: ['genosdb']
15+
}
16+
})
17+
```
18+
19+
This tells Vite to skip pre-bundling GenosDB, allowing the dynamic imports to resolve correctly at runtime.
20+
21+
## Webpack
22+
23+
No additional configuration is typically required for Webpack 5+.
24+
25+
## esbuild / Bun
26+
27+
No additional configuration required.
28+
29+
## CDN Usage
30+
31+
When loading GenosDB directly from a CDN, no bundler configuration is needed:
32+
33+
```html
34+
<script type="module">
35+
import { gdb } from 'https://cdn.jsdelivr.net/npm/genosdb@latest/dist/index.js'
36+
</script>
37+
```

0 commit comments

Comments
 (0)