Description
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
- Provide a bundler-agnostic solution for excluding files to watch :D
- Use the Vite watcher internally and expose the configuration ( see https://github.com/vitejs/vite/blob/main/packages/vite/src/node/watch.ts#L18 )
- Give me a hint to where the code for the watcher lies, so I can find a workaround to make ESBuild + Vite viable for us
Describe alternatives you've considered
No response