Which deployement method should I use, and how to test my site?

Didn't you ask the exact same question yesterday?

Anyway, since you are running this in the browser, you should probably go with what the documentation says: the web target makes the artifacts loadable in a browser. If you are planning to support really old systems (which it sounds like you aren't), you might need no-modules.

In that case, avoid bundlers by all means. They are anything but simple. At a previous job I had to deal with integrating a Rust WASM module I wrote into an old Node + NPM + Webpack system. It was a massive pain because none of the targets worked really well.

To be frank, it wasn't the fault of wasm-pack. WASM requires the entire dependency tree to be loaded using async, but the old codebase loaded everything synchronously (rewriting all of it was simply not an option), and the old Webpack they used didn't support native modules (upgrading which wasn't an option, either). So the only remaining option was to compile the wasm using no-modules, manually patch one of the central HTML files that got loaded unconditionally by the front page, and load the .wasm file there, independent of the bundler.

1 Like