Skip to content

Allow exclusion of files / folders from being watched by @angular-devkit/build-angular:application (ESBuild + Vite) #26644

Closed as not planned
@mirobo

Description

@mirobo

Command

serve

Description

According to https://angular.io/guide/esbuild it says:
The usage of Vite, much like the Webpack-based development server, is encapsulated within the Angular CLI dev-server builder and currently cannot be directly configured.

Webpack previously allowed a customWebpackConfig and therefore it was possible to exclude certain files and folders from the "watch" mechanism. With Vite this option is completely gone. In bigger setups with lots of libraries and Cypress/Jest tests residing in the folder of each library, the app gets rebuilt every time an irrelevant file (i.e. my-test.e2e.spec.ts, my-test.spec.ts or my-test.cy.ts) was changed.

Especially creating and editing Cypress tests becomes a real an absolute struggle because you have to wait for the build to be completed before you can run a test properly.

What I also find strange is this line: https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/src/builders/dev-server/vite-server.ts#L483

So where is the actual "watching" done, if not by Vite itself? Haven't found other hints..

Describe the solution you'd like

Ideas

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions