Skip to content

Commit d4ed91c

Browse files
authored
fix: add type declaration file (#33)
* add type declaration file * set eu
1 parent 732d6dd commit d4ed91c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
set -eu
4+
35
wasm-pack build --no-pack --out-name justified-layout-wasm --target web
6+
echo "export const MODULE: string;" > pkg/justified-layout-wasm-module.d.ts
47
echo "Uint8Array.fromBase64 ??= (string) => Uint8Array.from(atob(string), (c) => c.charCodeAt(0));" > pkg/justified-layout-wasm-module.js
58
echo "export const MODULE = Uint8Array.fromBase64('$(cat pkg/justified-layout-wasm_bg.wasm | base64 -w 0)');" >> pkg/justified-layout-wasm-module.js

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
},
99
"files": [
1010
"pkg/justified-layout-wasm.js",
11-
"pkg/justified-layout-wasm_bg.js",
1211
"pkg/justified-layout-wasm-module.js",
13-
"pkg/justified-layout-wasm.d.ts"
12+
"pkg/justified-layout-wasm.d.ts",
13+
"pkg/justified-layout-wasm-module.d.ts"
1414
],
1515
"main": "js/index.ts"
1616
}

0 commit comments

Comments
 (0)