@grida/canvas-wasm 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/.gitattributes +1 -0
- package/dist/grida-canvas-wasm.js +13 -7944
- package/dist/grida_canvas_wasm.wasm +0 -0
- package/dist/index.d.mts +63 -1
- package/dist/index.d.ts +63 -1
- package/dist/index.js +2046 -3621
- package/dist/index.mjs +2042 -3621
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -25,3 +25,27 @@ const scene = factory.createWebGLCanvasSurface(canvas);
|
|
|
25
25
|
// ready to draw
|
|
26
26
|
scene.loadDummyScene();
|
|
27
27
|
```
|
|
28
|
+
|
|
29
|
+
## Serving locally for development
|
|
30
|
+
|
|
31
|
+
For local development, this package has `serve` ready.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm install
|
|
35
|
+
pnpm serve
|
|
36
|
+
# will be served at http://localhost:4020/
|
|
37
|
+
# e.g. http://localhost:4020/dist/index.js
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For instance, you can use the locally served wasm like below.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
await init({
|
|
44
|
+
locateFile: (path) => {
|
|
45
|
+
if (process.env.NODE_ENV === "development") {
|
|
46
|
+
return `http://localhost:4020/dist/${path}`;
|
|
47
|
+
}
|
|
48
|
+
`https://unpkg.com/@grida/canvas-wasm@latest/${path}`,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|