Skip to content

Commit

Permalink
fix(vite-plugin-angular): remove caching of watched component templat…
Browse files Browse the repository at this point in the history
…es (#587)
  • Loading branch information
brandonroberts authored Aug 2, 2023
1 parent 4a2de22 commit fcc7aa4
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ export function angular(options?: PluginOptions): Plugin[] {
const templateUrlsResolver = new TemplateUrlsResolver();

function angularPlugin(): Plugin {
const watchedFiles = new Set<string>();

return {
name: '@analogjs/vite-plugin-angular',
async config(config, { command }) {
Expand Down Expand Up @@ -278,15 +276,6 @@ export function angular(options?: PluginOptions): Plugin[] {
// absolute path using the `|` symbol.
// For example: `./app.component.html|/home/projects/analog/src/app/app.component.html`.
const [, absoluteFileUrl] = urlSet.split('|');
if (watchedFiles.has(absoluteFileUrl)) {
continue;
}
// Vite also has a set of internally watched files, but it doesn't check if the
// file is already watched when calling `ensureWatchedFile`. Vite uses the Rollup
// file watcher, which invokes system calls to the filesystem, such as `existsSync`,
// `resolve`, etc. Our local set ensures we don't trigger redudant system calls if
// the file is already watched.
watchedFiles.add(absoluteFileUrl);
this.addWatchFile(absoluteFileUrl);
}
}
Expand Down

0 comments on commit fcc7aa4

Please sign in to comment.