You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm strongly for onerror hook too. I think to use eslint plugin which i will configure to throw on style errors/warnings, so i want to see more clearly the output of the ESLint, not that the plugin is failed.
src/index.js → dest/bar.cjs.js, dest/bar.es.js...
error: 'foo' is assigned a value but never used (no-unused-vars) at src/index.js:3:7:
1 | import add from './add.js'
2 |
> 3 | const foo = 123
| ^
4 | console.log(add({ a: 1, b: 2, c: 123 }))
5 |
1 error found.
[!] (eslint plugin) Error: Errors were found
src/index.js
Error: Errors were found
at error (/home/charlike/github/wooh/node_modules/rollup/dist/rollup.js:185:14)
at Object.error (/home/charlike/github/wooh/node_modules/rollup/dist/rollup.js:9141:6)
at promise.then.previous (/home/charlike/github/wooh/node_modules/rollup/dist/rollup.js:9150:32)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Function.Module.runMain (module.js:611:11)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
error Command failed with exit code 1.
ERROR: "build:node" exited with 1
+1. I was trying to create plugin that would catch errors and show toast notifications (like gulp-notify) and I have it functioning but I can't publish it as plugin because plugins have no way of hooking into errors, only warnings with onwarn. I currently have to use JS API directly and react to watcher events:
watcher.on('event', e => {
if (e.code == 'ERROR' || e.code === 'FATAL')
showNotification(e.error)
})
Usecase: when rollup runs in --watch mode in minimized window since I don't want it to take up space on my screen but i also really need to instantly know when build goes wrong.
Activity
TrySound commentedon Sep 13, 2017
@charlike Isn't
promise.catchwhat you need?tunnckoCore commentedon Sep 13, 2017
No. I want to mute plugin errors. I tried with the
onwarnbut it's logically that it is for plugin warnings and not plugin errors.edit: Exactly the whole problem is that the user dont have api to do that and to access errors that plugins throw.
MikeKovarik commentedon Oct 25, 2017
+1. I was trying to create plugin that would catch errors and show toast notifications (like
gulp-notify) and I have it functioning but I can't publish it as plugin because plugins have no way of hooking into errors, only warnings withonwarn. I currently have to use JS API directly and react to watcher events:Usecase: when rollup runs in --watch mode in minimized window since I don't want it to take up space on my screen but i also really need to instantly know when build goes wrong.
tunnckoCore commentedon Oct 25, 2017
Yup, absolutely. It can't be done even with plugin, cuz we just don't have api for such thing :D
MikeKovarik commentedon Oct 26, 2017
guybedford commentedon Jun 6, 2018
A
buildEndhook taking an error argument has been added in #2208. Feedback welcome.MikeKovarik commentedon Jun 12, 2018
Works great. I was able to finally finish rollup-plugin-notify. Thank you @guybedford
tunnckoCore commentedon Jun 12, 2018
@MikeKovarik that's cooool! :)
lukastaegert commentedon Jun 13, 2018
Great stuff! I added you to the wiki: https://github.com/rollup/rollup/wiki/Plugins#workflow-plugins