Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite usage - docs + exports modifications #600

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ const wasmTable = parquet.readParquet(...);

This specific endpoint will minify the ESM before you receive it.

### Vite

You can load the esm (default for vite) entrypoint via:
```js
import wasmInit, {readParquet} from 'parquet-wasm';
import wasmUrl from 'parquet-wasm/wasm?url';
H-Plus-Time marked this conversation as resolved.
Show resolved Hide resolved
await wasmInit(wasmUrl);
```
See https://vitejs.dev/guide/assets#explicit-url-imports
### Debug functions

These functions are not present in normal builds to cut down on bundle size. To create a custom build, see [Custom Builds](#custom-builds) below.
Expand Down
4 changes: 4 additions & 0 deletions templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
"types": "./esm/parquet_wasm.d.ts",
"default": "./esm/parquet_wasm.js"
},
"./wasm": {
"node": "./node/parquet_wasm_bg.wasm",
"default": "./esm/parquet_wasm_bg.wasm"
},
".": {
"node": {
"types": "./node/parquet_wasm.d.ts",
Expand Down
Loading