diff --git a/shared/tasks/scripts.mjs b/shared/tasks/scripts.mjs index 4bb573d56f..f490033709 100644 --- a/shared/tasks/scripts.mjs +++ b/shared/tasks/scripts.mjs @@ -43,14 +43,15 @@ export async function compileJavaScript([ // Create Rollup bundle(s) for (const options of config.options) { - const bundle = await rollup({ - ...options, + const bundle = await rollup(options) - // Handle warnings as errors - onwarn(message) { - throw message - } - }) + // Log warnings + config.warnings.flush() + + // Handle warnings as errors + if (config.warnings.warningOccurred) { + throw new Error(`Rollup input '${modulePath}' logged warnings`) + } // Compile JavaScript to output format await Promise.all(