shritesh / zig-wasm-dom

Zig + WebAssembly + JS + DOM
https://shritesh.github.io/zig-wasm-dom/
135 stars 13 forks source link

zig build does not produce wasmtest.wasm #6

Open rhelsing opened 2 years ago

rhelsing commented 2 years ago
Screen Shot 2022-04-09 at 3 18 50 PM

This is the output of the zig build command.

I'm using 0.9.1

seungjin commented 1 year ago

@rhelsing Small syntax update needed for 0.9.1 See this: https://github.com/shritesh/zig-wasm-dom/pull/5/commits/c36d71c03dc809363bbf36e267b421150353c7df

To compile: zig build-lib -O ReleaseSmall -targe wasm32-wasi -dynamic src/zigdom.zig

You get zigdom.wasm and it works well.

sanabel-al-firdaws commented 1 year ago

im using zig-0.11.0-dev (1) - clone this repo

the new build command needs (-rdynamic) flag

(2) run " zig build-lib -O ReleaseSmall -target wasm32-wasi -dynamic -rdynamic zigdom.zig "

(3) serve with any http server that support file change refresh (opening the html file won't do anything) a good way to do that is using this > https://github.com/yandeu/five-server

i heard that zig has http server built in the std library now but i haven't tried it it seems to be blazingly fast so thats cool