Skip to content

Commit

Permalink
Allow consumers to override Rollup warning handler
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robertknight committed Nov 25, 2024
1 parent 887cc26 commit 30520fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}),
Expand All @@ -47,8 +47,8 @@ export async function watchJS(rollupConfig) {

const watcher = rollup.watch(
configs.map(config => ({
...config,
onwarn: logRollupWarning,
...config,
})),
);

Expand Down

0 comments on commit 30520fa

Please sign in to comment.