(output_dir: Path)
| 206 | |
| 207 | |
| 208 | def copy_dist_to_output(output_dir: Path) -> None: |
| 209 | dist_dir = build_dist() |
| 210 | hash_marker = output_dir / ".frontend_hash" |
| 211 | current_hash = _compute_dir_hash(dist_dir) |
| 212 | if ( |
| 213 | hash_marker.exists() |
| 214 | and hash_marker.read_text(encoding="utf-8").strip() == current_hash |
| 215 | ): |
| 216 | print("[WASM] Frontend assets unchanged, skipping copy") |
| 217 | return |
| 218 | |
| 219 | for item in dist_dir.iterdir(): |
| 220 | destination = output_dir / item.name |
| 221 | if item.is_dir(): |
| 222 | _copy_tree(item, destination) |
| 223 | else: |
| 224 | _copy_file(item, destination) |
| 225 | |
| 226 | hash_marker.write_text(current_hash, encoding="utf-8") |
no test coverage detected