@grida/canvas-wasm 0.0.4 → 0.0.6

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 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