Im trying to write my own WebpackPlugin. It works just fine (it moves some generated files, and then combines those).
It listens to the 'done' event of the webpack compiler. But the following happens:
compiler.plugin('done', (stats) =>
{
//dont continue when there were build errors
if(stats.compilation.errors && stats.compilation.errors.length) return;
//yet this code gets triggered continously, while webpack only outputs asset information once.
- the event is triggered once after a succesfull build
- the event is triggered once after I introduce a code error
- the event keeps being triggered continuously after I remove the error
The only loader I'm using is ts-loader. Is this normal behaviour I should I seek a resolution by digging into the loader?
Im trying to find a different event, but with emit
the exact same thing happens. Also I'm trying to investigate the info in stats to see if I can detect that no new assets or files were created, but can't seem to find it yet.
Any tips?