diff --git a/build.rs b/build.rs index 6dfbb442..67772430 100644 --- a/build.rs +++ b/build.rs @@ -113,39 +113,30 @@ fn process_release(manifest_dir: &Path, static_dir: &Path, out_dir: &Path) { // ── 4. Minify ALL individual CSS in static-dist/ ───────────────────────── minify_tree_css(&dist_dir.join("css")); - // ── 5. Build JS bundle for index.html ──────────────────────────────────── - let index_html = fs::read_to_string(static_dir.join("index.html")).expect("read index.html"); - let defer_scripts = extract_defer_scripts(&index_html); - let js_bundle = build_js_bundle(static_dir, &defer_scripts); - let js_hash = fnv_hash(js_bundle.as_bytes()); - let js_name = format!("app.{js_hash}.js"); - fs::write(dist_dir.join("js").join(&js_name), &js_bundle).expect("write js bundle"); - - // ── 6. Minify ALL individual JS in static-dist/ ────────────────────────── + // ── 5. Minify ALL individual JS in static-dist/ ────────────────────────── + // ES modules cannot be safely concatenated into a flat bundle — each file is + // minified in-place instead. The HTML keeps its individual ")); - defer_done = true; - } - continue; - } - - // ── Drop "Service Worker Registration" comment ────────────────────── - if t.contains("Service Worker Registration") { - continue; - } - - // ── Drop "Styles" / "Scripts" section comments ────────────────────── - if t.starts_with("