-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//import initWASM from "@aduh95/viz.js/worker"; | ||
// If you are not using a bundler that supports package.json#exports | ||
// use "./node_modules/@aduh95/viz.js/dist/render.browser.js" instead. | ||
import initWASM from "../node_modules/@aduh95/viz.js/dist/render.browser.js"; | ||
|
||
// You need to configure your bundler to treat `.wasm` file as file to return a URL. | ||
//import wasmURL from "@aduh95/viz.js/wasm"; | ||
// With Rollup, use the `@rollup/plugin-url` plugin and add `**/*.wasm` to the | ||
// `include` list in the plugin config. | ||
// With Webpack, use the `file-loader` plugin: "file-loader!@aduh95/viz.js/wasm" | ||
|
||
// If you are not using a bundler that supports package.json#exports | ||
// or doesn't have a file-loader plugin to get URL of the asset: | ||
const wasmURL = | ||
new URL("../node_modules/@aduh95/viz.js/dist/render.wasm", import.meta.url); | ||
|
||
initWASM({ | ||
locateFile() { | ||
return wasmURL; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters