Could the HTML5 dmloader become a node module?

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.

Example stories:

  • 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.


Since anyone can make this it should be a community project. Try getting the ball rolling on your own and document your progress / there may be others more familiar with that ecosystem who may be able to help.


I agree with @Pkeod . This is perfect as a community driven project. If there are specific changes required to dmloader to make this happen then we’d be happy to discuss those.

1 Like