// ============================================================ // FINAL GUARD: Disable ALL Minification for SQLite-WASM stability // ============================================================ // WHY THIS FILE EXISTS: // Kotlin/JS loads webpack.config.d files in alphabetical order. // This file is prefixed with "z_" to ensure it runs LAST — // AFTER Kotlin/ JS, and all other plugins have had their chance // to set config.optimization. This guarantees that no Terser // or another minimizer plugin can re-enable itself after this point. // // ROOT CAUSE: // sqlite3-worker1.mjs contains a top-level `return` statement // that is valid for browser-worker scripts but crashes Terser. // Disabling minification for the entire shell module is the // most stable fix in the context of WASM-heavy KMP projects. // (Performance trade-off is negligible for WASM bundles.) // // REFERENCE: docs/99_Journal for build history. // ============================================================ console.log("[z_disable-minification] Enforcing minimize=false as FINAL webpack config step."); config.optimization = config.optimization || {}; config.optimization.minimize = false; config.optimization.minimizer = []; console.log("[z_disable-minification] Terser and all minimizers are now DISABLED.");