In Bazel, the `CI` environment variable is not set due to its hermetic nature. As a result, caching is enabled by default, which includes Vite pre-bundling. This is unnecessary in CI environments.
In some cases, this leads to errors during CI runs when the Vite build is closed or canceled prematurely, resulting in the following errors:
```
Error: R] The build was canceled
Error: R] Terminating worker thread [plugin angular-vite-optimize-deps]
```
PR Close#57863
This is needed to better support native ESM modules and avoid the otherwise necessary deep imports like `zone.js/fesm2015/zone-node.js` due to disallowed directory imports.
PR Close#51652
Since v15, prod mode is handled by the CLI with the `optimization` flag. We can remove the environement files and `enableProdMode` when the tests use the CLI.
PR Close#49746
This commit adds an integration test that uses `@angular/elements` with
`@angular/platform-server` in order to highlight a current
incompatibility. The issue will be fixed in a subsequent commit.
PR Close#40559