From 7408a33be79967a049f82edd97b58001b1e23b34 Mon Sep 17 00:00:00 2001 From: Rick Wong Date: Mon, 20 Oct 2025 18:20:46 +0200 Subject: [PATCH] Removed wasm rel-preload link from bundle index.html to save bandwidth for Safari users (#4796) --- packages/cli/src/build/request.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/build/request.rs b/packages/cli/src/build/request.rs index 09fb4967e..1be64e07e 100644 --- a/packages/cli/src/build/request.rs +++ b/packages/cli/src/build/request.rs @@ -4826,10 +4826,10 @@ __wbg_init({{module_or_path: "/{}/{wasm_path}"}}).then((wasm) => {{ } } - // Manually inject the wasm file for preloading. WASM currently doesn't support preloading in the manganis asset system - head_resources.push_str(&format!( - "" - )); + // Do not preload the wasm file, because in Safari, preload as=fetch requires additional fetch() options to exactly match the network request + // And if they do not match then Safari downloads the wasm file twice. + // See https://github.com/wasm-bindgen/wasm-bindgen/blob/ac51055a4c39fa0affe02f7b63fb1d4c9b3ddfaf/crates/cli-support/src/js/mod.rs#L967 + Self::replace_or_insert_before("{style_include}", "