You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnts.visitEachChild(source, (n) => n, context);
186
+
};
177
187
}
178
188
},
179
189
{
@@ -250,7 +260,31 @@ typescript({
250
260
251
261
Note on watch mode
252
262
253
-
When running Rollup in watch mode, this plugin recreates custom transformer factories after each TypeScript program rebuild so they receive the current Program and TypeChecker. If your transformer needs to query the latest type information across rebuilds, prefer using the optional `getProgram()` parameter provided to `program`-based transformer factories.
263
+
By default (legacy behavior), this plugin reuses the same custom transformer factories for the lifetime of a watch session. Advanced users can opt into recreating factories on every TypeScript rebuild by enabling the `recreateTransformersOnRebuild` option. When enabled, both `program`- and `typeChecker`-based factories are rebuilt per watch cycle, and `getProgram()` (when used) reflects the latest Program across rebuilds.
264
+
265
+
### `recreateTransformersOnRebuild`
266
+
267
+
Type: `Boolean`<br>
268
+
Default: `false` (legacy behavior)
269
+
270
+
When `true`, the plugin recreates custom transformer factories on each TypeScript watch rebuild. This ensures factories capture the current `Program`/`TypeChecker` per cycle and that the optional `getProgram()` getter provided to `program`-based factories reflects the latest `Program` across rebuilds. Most users do not need this; enable it if your transformers depend on up‑to‑date Program/TypeChecker identities.
271
+
272
+
```js
273
+
// Opt-in to per-rebuild transformer recreation in watch mode
0 commit comments