Skip to content

Commit

Permalink
Add Vite usage example (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
macjuul authored Aug 7, 2024
1 parent 805873f commit b4d33e6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,21 @@ await db.connect("indxdb://demo");

// Now use the JavaScript SDK as normal.
```

## Usage with Vite

When using [Vite](https://vitejs.dev/) the following configuration is recommended to be placed in your `vite.config.ts`

```js
optimizeDeps: {
exclude: ['surrealdb.wasm', 'surrealql.wasm'],
esbuildOptions: {
target: 'esnext',
},
},
esbuild: {
supported: {
'top-level-await': true
},
}
```

0 comments on commit b4d33e6

Please sign in to comment.