Skip to content

Commit cfe90e1

Browse files
committed
fix component composition order
1 parent d21bbf6 commit cfe90e1

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

crates/unavi-app/build.rs

+16-10
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,22 @@ fn main() {
5959
}
6060

6161
// Compose components.
62-
for entry in std::fs::read_dir(wasm_out.clone()).expect("Failed to read directory") {
63-
let entry = entry.expect("Failed to read directory entry");
64-
let path = entry.path();
65-
66-
for entry_2 in std::fs::read_dir(wasm_out.clone()).expect("Failed to read directory") {
67-
let entry_2 = entry_2.expect("Failed to read directory entry");
68-
let path_2 = entry_2.path();
69-
70-
let path_a = path.as_os_str().to_str().unwrap();
71-
let path_b = path_2.as_os_str().to_str().unwrap();
62+
// We must manually specify the order of composition via this array.
63+
for name in [
64+
"unavi_vscreen.wasm",
65+
"unavi_ui.wasm",
66+
"unavi_shapes.wasm",
67+
"unavi_scene.wasm",
68+
"unavi_layout.wasm",
69+
] {
70+
let path_a: PathBuf = [wasm_out.to_str().unwrap(), name].iter().collect();
71+
72+
for entry_b in std::fs::read_dir(wasm_out.clone()).expect("Failed to read directory") {
73+
let entry_b = entry_b.expect("Failed to read directory entry");
74+
let path_b = entry_b.path();
75+
76+
let path_a = path_a.as_os_str().to_str().unwrap();
77+
let path_b = path_b.as_os_str().to_str().unwrap();
7278

7379
let output = Command::new("wac")
7480
.args(["plug", "--plug", path_a, path_b])

0 commit comments

Comments
 (0)