Skip to content

Commit

Permalink
fix(vite-plugin-angular): skip rebuilds before invalidation during te…
Browse files Browse the repository at this point in the history
…sting (#1536)
  • Loading branch information
brandonroberts authored Jan 3, 2025
1 parent 4d32955 commit 4610be7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,11 @@ export function angular(options?: PluginOptions): Plugin[] {
if (isTest) {
const tsMod = viteServer?.moduleGraph.getModuleById(id);
if (tsMod) {
sourceFileCache.invalidate([id]);
const invalidated = tsMod.lastInvalidationTimestamp;

if (testWatchMode && invalidated) {
sourceFileCache.invalidate([id]);

if (testWatchMode) {
await buildAndAnalyze();
}
}
Expand Down

0 comments on commit 4610be7

Please sign in to comment.