Optimize build process: add stale cache cleanup, ensure minification is disabled for SQLite-WASM stability, and improve source map handling
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 10m3s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 10m17s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 3m17s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 2m1s

This commit is contained in:
2026-03-04 19:32:14 +01:00
parent e6aa22acdb
commit 178aa97133
4 changed files with 48 additions and 39 deletions
@@ -0,0 +1,27 @@
// ============================================================
// 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 other 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.");