Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-file HTML Export #72

Open
Davidobot opened this issue Nov 25, 2022 · 4 comments
Open

Single-file HTML Export #72

Davidobot opened this issue Nov 25, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Davidobot
Copy link
Owner

Twitter source:

the ability to create single file html loves to use on client browsers like schellingb did?

@Davidobot Davidobot added the enhancement New feature or request label Nov 25, 2022
@alexjgriffith
Copy link

For future reference: you can use the EMSCRIPTEN_ARGS --pre-js and --post-js to wrap the wasm build, and setting MODULARIZE=0 should merge output files.

https://stackoverflow.com/questions/29329240/emscripten-with-module-loaders#29332498

@SugarRayLua
Copy link

@alexjgriffith,
Would you be able to describe the steps one would take to use those EMSCRIPTEN_ARGS to wrap the wasm build produced from love.js (i.e. 1. Execute love.js per npm/github instructions 2. On the .wasm file produced do...)

Trying to go from reading what the stackflow responded recommended to how I'd actually apply that to the love.js output still seems above my novice js skills.

If it is actually too many steps/too involved to explain further on this forum, I understand. If you were able to provide more detail, I think others in the love community would be interested to try your suggestion.

Thanks :-)

@alexjgriffith
Copy link

These flags would be used in the build stage of lovejs itself. These are flags emscripten could use to wrap the output of its compilation.

Unfortunately they only solve one of the problems (the need for a seperate index.html and game.js). The other problem is compiling lovejs in a way that embeds the wasm in the output, rather than in its own file.

There are techical limitations on our build right now that limit us from doing that for the release target. Key functions we use were dropped in emscripten v 2.06 and even more were dropped 3.58 (the emscripten team does not do a great job announcing deprecation).

Once we get 3.59 working and stable there should be a way to build a single file html target.

@SugarRayLua
Copy link

Thank you very much @alexjgriffith. I'll be very much looking forward to that time :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants