From 30520faf35b629242cfb7b9a8057d2c0516894fa Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Mon, 25 Nov 2024 08:57:44 +0000 Subject: [PATCH] Allow consumers to override Rollup warning handler Let the `onwarn` handler set by downstream projects in their Rollup configs override the default one used by the `buildJS` and `watchJS` functions exported by this project. --- lib/rollup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rollup.js b/lib/rollup.js index 82bae78..2403fe7 100644 --- a/lib/rollup.js +++ b/lib/rollup.js @@ -27,8 +27,8 @@ export async function buildJS(rollupConfig) { await Promise.all( configs.map(async config => { const bundle = await rollup.rollup({ - ...config, onwarn: logRollupWarning, + ...config, }); await bundle.write(config.output); }), @@ -47,8 +47,8 @@ export async function watchJS(rollupConfig) { const watcher = rollup.watch( configs.map(config => ({ - ...config, onwarn: logRollupWarning, + ...config, })), );