ceifa / wasmoon

A real lua 5.4 VM with JS bindings made with webassembly
MIT License
462 stars 27 forks source link

The js file is quite large when use it in a browser #63

Closed sunzhuo closed 1 year ago

sunzhuo commented 1 year ago

I use browerify to let index.js be usable in a browser, which results in an 866K file. It's quite large. Anything wrong?

ceifa commented 1 year ago

Wasmoon it's usable on browser by default, browserify it's not needed.

sunzhuo commented 1 year ago

I am new to web development. Can you give me a simple example? I use a web worker import {LuaFactory} from './index.js';. Is that correct? If I add this line, the worker can not respond to postmessage.

sunzhuo commented 1 year ago

I figured it out. Use following two line in the web worker. importScripts('./index.js'); const factory = new wasmoon.LuaFactory();