refactor: move generateRound = 0 to buildEnd (#390)

- since the `buildEnd` hook exists nowadays, we can just reset it there, right before `generateBundle` is called for each output and increments it per output
- also modify the comment to account for this change and the fact that `buildEnd` exists and is used nowadays
This commit is contained in:
Anton Gilgur 2022-08-08 15:15:24 -04:00 committed by GitHub
parent 70c6e253e8
commit 3dda648f0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,8 +197,6 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
transform(code, id)
{
generateRound = 0; // in watch mode transform call resets generate count (used to avoid printing too many copies of the same error messages)
if (!filter(id))
return undefined;
@ -267,6 +265,8 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
buildEnd(err)
{
generateRound = 0; // in watch mode, buildEnd resets generate count just before generateBundle for each output
if (err)
{
buildDone();