`postcss-loader` version 4.2.0 added an `implementation` option. Using the using will ensure that the correct postcss version is used.
More info: deac9787eeFixes#19839
This change adds the following polyfills for IE11 (`nomodule` browsers):
ES2016:
Array.prototype.includes
ES2017:
Object.entries
Object.values
Object.getOwnPropertyDescriptors
ES2019:
Object.fromEntries
Array.prototype.flat
Array.prototype.flatMap
The newly introduced library linker mode that removes the need for ngcc is integrated into the Angular CLI's build system. This allows libraries that are built in linker mode to be used when building an application.
This change adds internal support for providing a custom file watching mechanism to the browser (and associated) builders. The support integrates and overrides the Webpack watch system when enabled. This is currently intended to support builder unit testing use cases.
This changes the internal Angular Karma plugin's asset fallback middleware to rewrite the request URL directly instead of trying to copy the request properties. With changes in newer Node.js versions, not all request properties may be enumerable.
Fixes: #19644
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
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.
This change integrates the Ivy Webpack compiler plugin into the browser builder.
When Ivy is enabled, which is the default behavior for applications, this plugin will now be used.
If needed, the previous plugin can still be used by enabling the `NG_BUILD_IVY_LEGACY` environment variable.
A custom babel preset is introduced to centralize the configuration of babel within the package. Application related presets and plugins are now encapsulated within the custom preset which is used via the Webpack babel-loader. This new custom preset will also provide the integration point for the upcoming Angular linker.
With updates to the `license-webpack-plugin` and adjustments to the web worker plugin configuration, license extraction can now be used with webpack 5. This change also removes the need to filter out the duplicate asset warning on Webpack 4 that was previously being generated.
With this change function and arrow function arguments are not wrapped in parenthesis during the optimization phase.
`wrap_func_args` which is enabled by default in terser will wrap function arguments in parenthesis. Recently this was also changed to wrap lamdas as well:
66c3a5ce66
An increase in bundle size was observed without this change. See: https://github.com/angular/angular/pull/39432#discussion_r512345752
With this change we remove the unintentional breaking change that added publicHost pathname to sockPath instead we now prepend the sockPath with the servePath, which can be either the passed servePath option, baseHref or deployUrl.
By default subdirectories within a symlinked directory are not searched by a glob. The new `followSymlinks` option for the longhand form of the `assets` browser builder option now allows opting in to search such subdirectories.
BREAKING CHANGE:
Deprecated `rebaseRootRelativeCssUrls` browser builder option has been removed without replacement. This option was used to change root relative URLs in stylesheets to include base HREF and deploy URL and was used only for compatibility and transition as this behavior is non-standard.
This commits adds a base href value in the karma context iframe used to run unit tests where a unit test throws:
No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.
Even if the application is fine.
This is because the index.html from Angular CLI contains a base href value, but not the Karma context iframe.
So when adding a unit test with a testing module that imports a NgModule, for example AppModule,
which itself imports RouterModule, the unit test used to throw an error (regression appeared in router 3.1).
That could be solved by either adding `RouterTestingModule` to the testing module,
or by adding a provider `{ provide: APP_BASE_HREF, useValue: '/' }`, but required to understand the issue.
This solves the issue in a transparent way: developers won't even encounter the problem anymore.
Closes#19116