From 493a7dd36ea2e4c19fc10e2893813566e89e4342 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 29 Jun 2026 11:28:14 +0200 Subject: [PATCH] fix(build): fail on warnings emitted during the generate phase failOnWarningsPlugin checked the warning count in buildEnd, which runs before chunk-generation warnings (e.g. INEFFECTIVE_DYNAMIC_IMPORT) are emitted, so those never failed the build. Move the check to closeBundle, the last hook. Assisted-by: Claude:Opus-4.8 --- vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 85d8626914d..8ff0769afd4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -45,7 +45,7 @@ function failOnWarningsPlugin(): Rolldown.Plugin { onLog(level) { if (level === 'warn') warningCount++; }, - buildEnd() { + closeBundle() { if (!warningCount) return; throw new Error(`${warningCount} warnings present`); },