Skip to content

Commit 3dda648

Browse files
authored
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
1 parent 70c6e25 commit 3dda648

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
197197

198198
transform(code, id)
199199
{
200-
generateRound = 0; // in watch mode transform call resets generate count (used to avoid printing too many copies of the same error messages)
201-
202200
if (!filter(id))
203201
return undefined;
204202

@@ -267,6 +265,8 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
267265

268266
buildEnd(err)
269267
{
268+
generateRound = 0; // in watch mode, buildEnd resets generate count just before generateBundle for each output
269+
270270
if (err)
271271
{
272272
buildDone();

0 commit comments

Comments
 (0)