Deploying Rust and WebAssembly to Production

⚡ Deploying Web applications built with Rust and WebAssembly is nearly identical to deploying any other Web application!

To deploy a Web application that uses Rust-generated WebAssembly on the client,copy the built Web application's files to your production server's file systemand configure your HTTP server to make them accessible.

Ensure that Your HTTP Server Uses the application/wasm MIME Type

For the fastest page loads, you'll want to use theWebAssembly.instantiateStreaming function to pipelinewasm compilation and instantiation with network transfer (or make sure yourbundler is able to use that function). However, instantiateStreaming requiresthat the HTTP response has the application/wasm MIME type set, or else itwill throw an error.

More Resources