Skip to content

Commit 4506658

Browse files
committed
feat: up zip download url
1 parent e6cbab6 commit 4506658

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ dist-ssr
2121
*.njsproj
2222
*.sln
2323
*.sw?
24+
25+
public/wa.wasm.zip

src/lib/wawasm.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ type TWasmInst = WebAssembly.Instance & {
1010
}
1111

1212
const zip = new JSZip()
13-
const WASM_ZIP_URL = '/wa.wasm.zip'
13+
const isDEV = import.meta.env.DEV || import.meta.env.MODE === 'development'
14+
const WASM_ZIP_URL = isDEV
15+
? './wa.wasm.zip'
16+
: 'https://wa-lang.org/wa/wa-js/wa.wasm.zip'
1417

1518
export async function initWaWasm() {
1619
const { wasmInst, go, actions } = useWasmStore.getState()

0 commit comments

Comments
 (0)