Currently the default html output for HTML5 is an index page that loads the dmloader as a script. I recently got the dmloader.js script running in a Nuxt3/Vue3 page by loading the script into the DOM.
I was wondering if Defold would consider publishing an npm package that could take the place of the dmloader.js script? That way we can just put the wasm/archive files somewhere and point to their path with the dmloader’s export.
- I want to be able to load the dmloader script as an ES module in React, Vue, etc frameworks.
- The module should be able to load the wasm/archive files by pointing to their path
- The module should have a public function that points it to a DOM object where the engine should be loaded.
- The module should expose sizing/options/extra params.
- OPTIONAL: we could also leverage the JsToDef library to allow users to pass arguments into the engine while it’s running.
Making something like this is on my to-do list after I get my game into public alpha btw. If I’m successful I’ll publish the module to npm. An official module would be nice also.