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
write enabled by default in esbuild? Perhaps if write is undefined it shouldn't force reload.
- The plugin states
"write" option is disabled, so CSS updates will trigger a full reload which I ignored since I wasn't working with CSS. It appears this affects JS only changes too?
- Currently
msg.errors?.length check is done at the end of thechange event. What do you think about doing it at the beginning? And then return early if there are errors so we can see them even if forceReload is true. I always want to see errors.
Thanks for the awesome plugin!
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
forceReloadwastruecausing the reload to happen before the error could be shown. This was true becausewrite: trueneeded to be set on my esbuild config. A few ideas to make this more intuitive.writeenabled by default in esbuild? Perhaps ifwriteis undefined it shouldn't force reload."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?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!