unjs / unplugin

Unified plugin system for Vite, Rollup, Webpack, esbuild, Rolldown, and more

Home Page:https://unplugin.unjs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: `buildError` hook to run when an error occurs

tropicalraisel opened this issue · comments

This hook would be called every time an error occurs during builds. The error object would be passed to the callback.

I think we need to stick with Rollup's plugin API and add new hooks if it's absolutely necessary. In your case, I think it's better to do try-catch in your transform / load hooks.

True, but this would be triggered when any error is thrown. This could be great when detecting conflicts with other plugins, if an error stopped a build or threw an error that was intentionally ignored, and detecting framework-specific issues.