Ideally when you install a dependency (@babylonjs/havok), it should works âout of the box.â Iâm not sure how it typically works with WebAssembly but it would be better not to have to manually copy the wasm into the assets. Still this is nice workaround thx.
it would be great if everything would work like in a proper ecosystem . The proplem is that we have 99 build systems, and they all have problems. Or 99 problems and they are all in the build systems?
If vite decides to not follow its own build process when in dev mode there is sadly little we can do about it. It does work if you build for production. As it should. The havok package is built according to the package.json/npm standard, and should work out of the box. It does, in most systems. If it doesnât, I want to know about it, so we can fix it. Unless it is an issue with the other system
Here, the way it worked for me (Babylson.js + Vite + Havok) was by directly loading the wasm file from the asset folder. To enable it to function correctly on the server, I needed to include an .htaccess file. Additionally, to ensure it works locally, adjustments were made to the Vite configuration. Below are the files: