fix: fixed wasm and js paths in release mode (#4140)
This commit is contained in:
1 parent
18477a0373
commit
0a18c12c32
1 file changed
+7
-7
@@ -3148,11 +3148,8 @@ impl BuildRequest {
|
|||||||
// In release mode, we make the wasm and bindgen files into assets so they get bundled with max
|
// In release mode, we make the wasm and bindgen files into assets so they get bundled with max
|
||||||
// optimizations.
|
// optimizations.
|
||||||
let wasm_path = if self.release && !should_bundle_split {
|
let wasm_path = if self.release && !should_bundle_split {
|
||||||
// Register the main.js with the asset system so it bundles in the snippets and optimizes
|
// Make sure to register the main wasm file with the asset system
|
||||||
let name = assets.register_asset(
|
let name = assets.register_asset(&post_bindgen_wasm, AssetOptions::Unknown)?;
|
||||||
&self.wasm_bindgen_js_output_file(),
|
|
||||||
AssetOptions::Js(JsAssetOptions::new().with_minify(true).with_preload(true)),
|
|
||||||
)?;
|
|
||||||
format!("assets/{}", name.bundled_path())
|
format!("assets/{}", name.bundled_path())
|
||||||
} else {
|
} else {
|
||||||
let asset = self.wasm_bindgen_wasm_output_file();
|
let asset = self.wasm_bindgen_wasm_output_file();
|
||||||
@@ -3160,8 +3157,11 @@ impl BuildRequest {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let js_path = if self.release && !should_bundle_split {
|
let js_path = if self.release && !should_bundle_split {
|
||||||
// Make sure to register the main wasm file with the asset system
|
// Register the main.js with the asset system so it bundles in the snippets and optimizes
|
||||||
let name = assets.register_asset(&post_bindgen_wasm, AssetOptions::Unknown)?;
|
let name = assets.register_asset(
|
||||||
|
&self.wasm_bindgen_js_output_file(),
|
||||||
|
AssetOptions::Js(JsAssetOptions::new().with_minify(true).with_preload(true)),
|
||||||
|
)?;
|
||||||
format!("assets/{}", name.bundled_path())
|
format!("assets/{}", name.bundled_path())
|
||||||
} else {
|
} else {
|
||||||
let asset = self.wasm_bindgen_js_output_file();
|
let asset = self.wasm_bindgen_js_output_file();
|
||||||
|
|||||||
Reference in new issue
Block a user