By configuring the optimizer (`terser`) to be aware that the Angular `forwardRef` helper function is a pure function, the optimizer can completely remove the helper call when the return value is unused.
This is another feature that we mentioned in the Eliminate Render Blocking Requests RFC (#18730)
Inlining of critical CSS is turned off by default. To opt-in this feature set `inlineCritical` to `true`.
Example:
```json
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": {
"styles": {
"minify": true,
"inlineCritical": true,
}
},
```
To learn more about critical CSS see;
https://web.dev/defer-non-critical-csshttps://web.dev/extract-critical-css/
In a future version of the Angular CLI `inlineCritical` will be enabled by default.
Closes: #17966Closes: #11395Closes: #19445
With upstream fixes in place, the default Webpack 5 caching behavior can now be enabled. In development mode, memory caching will now be used, and in production, caching will be disabled as per Webpack 5 default behavior.
With this change we apply sourcemaps of libraries in a monorepo without the need to enable `vendor: true`. This is more intuitive behavior and in line with what the users expect.
We also suppress the `Failed to parse source map from` in-actionable warning.
Closes#11305
With this change we set the publicHost to `0.0.0.0:0`, when it's not provided.
This solved issues where previously the publicHost needed to be specified directly to get around `ERR_SSL_PROTOCOL_ERROR` error when proxing https -> http.
NB: this was also the behaviour in version 10 c252968225/packages/angular_devkit/build_angular/src/dev-server/index.ts (L170)Closes#19403
The `ng-update` field errantly caused this package to show up in the ng update list. The package group with `codelyzer` also did not provide a benefit as `codelyzer` is updated via a migration and tslint support is now deprecated.
With this change we cleanup the index generation. The `IndexHtmlWebpackPlugin` now extends the base `IndexHtmlGenerator` class which makes it easier to override methods to retrieve compilation assets. This is important for the critical css extraction implementation because Critters needs to access the `assets` from the either the compilation when running in memory or the file-system.
This change updates the internal postcss plugins to use the postcss 8 API as well as updates the versions of all external plugins to postcss 8 supported versions.