Difficulty seeing errors in esbuild-plugin-livereload
The livereload plugin has a great looking error overlay but I had difficulty getting it to work. After a bit of debugging I noticed that forceReload was true causing the reload to happen before the error could be shown. This was true because write: true needed to be set on my esbuild config. A few ideas to make this more intuitive.
- Isn't
writeenabled by default in esbuild? Perhaps ifwriteis undefined it shouldn't force reload. - The plugin states
"write" option is disabled, so CSS updates will trigger a full reloadwhich I ignored since I wasn't working with CSS. It appears this affects JS only changes too? - Currently
msg.errors?.lengthcheck is done at the end of thechangeevent. What do you think about doing it at the beginning? And then return early if there are errors so we can see them even ifforceReloadis true. I always want to see errors.
Thanks for the awesome plugin!
Hi! Sorry for the long response delay on this, I was insanely busy late last year.
I think your ideas could make a lot of sense. Would you be open to contributing them? I won't have time to do more than basic dependency upgrades on these projects for the foreseeable future.
@jgoz thanks for the response. I understand about being busy! I'll try to take a look at submitting a PR for this some day. I got it working as-is in my current project so I don't have a pressing need. 😄