Ability to be used offline
TechStudent10 opened this issue · 10 comments
There is no need to be online to use wasmoon. You can use the local copy of the wasm file if you want.
Example of this using webpack: Drumsin/aoe4-generated-map-debugger#6
There is no need to be online to use wasmoon. You can use the local copy of the wasm file if you want. Example of this using webpack: Drumsin/aoe4-generated-map-debugger#6
Thank you!
@ceifa should note that I'm not using webpack, but rather Vite.
@ceifa please get back to me. Once again, I'm using Vite (TypeScript) and I've moved to Tauri. When building it, the app fails to fetch because glue.wasm
is being served over http
. I can't build my application without removing wasmoon
.
This will be fixed on the next release, for now you can just pass the url as parameter to the factory:
new LuaFactory("https://unpkg.com/wasmoon/dist/glue.wasm")
This will be fixed on the next release, for now you can just pass the url as parameter to the factory:
new LuaFactory("https://unpkg.com/wasmoon/dist/glue.wasm")
You misunderstood me. While this is a temporary fix, I want to be able to serve it offline.
Finally found a fix. If you are using Vite, you need to copy the glue.wasm
file from node_modules/wasmoon/dist/
to your assets/public folder. Then, you can instantiate LuaFactory
like so:
new LuaFactory("/glue.wasm")
below is working for me:
import wasmoonGlueUrl from "wasmoon/dist/glue.wasm?url"
const factory = new LuaFactory(wasmoonGlueUrl)
ref: