Make it possible to configure dev-server to send custom HTTP headers on
every client request. These headers can be specified as a key-value map
under the new "headers" property of the dev-server builder in
angular.json. These headers are then passed on to the webpack devserver.
An example use case for this is to enable various security features,
such as CSP and Trusted Types, both in local application development and
in integration tests, by setting appropriate HTTP headers.
This is part of an effort to add support for Trusted Types in Angular.
The ability to enforce Trusted Types during development and integration
tests is essential, as this can help detect Trusted Types violations
that might otherwise break applications when they're pushed to
production where such security features may be enforced.
With this change we deprecate servePathDefaultWarning and hmrWarning which no longer has an effect.
Using any unsupported deploy-url or base-href serve path value will result in a hard warning.
With this change we deprecate a number of dev-server builder options which proxied to the browser builder. This pattern also wrongly assumes that 3rd party browser builders also support all these options.
Configure the below deprecated options directly in the browser builder target options instead.
- aot
- sourceMap
- deployurl
- baseHref
- vendorChunk
- commonChunk
- optimization
- progress
When building an application for i18n extraction we are currently redundantly processing components stylesheets. With this change we replace the components stylesheets with an empty string which helps reduce the i18n build time.
Tslint has been added as an optional peer dependency which makes this check unnecessary since the package manager will issue a warning when an incorrect version is installed.
tslint is currently used by the tslint builder within this package but is not represented in the dependencies. The can lead to accidental version mismatches as well as package manager hoisting problems due to the package manager not knowing the full dependency set of the package.
karma is currently used by the karma builder within this package but is not represented in the dependencies. The can lead to accidental version mismatches as well as package manager hoisting problems due to the package manager not knowing the full dependency set of the package.
As of Angular v11, IE9 and IE10 are no longer officially supported. A warning will now be shown during builds if these browsers are requested in the project's browserslist configuration.
The browser builder's `styles` and `scripts` options now support using a package name in the path when specifying a style or script. This removes the need to use a relative path to the node modules directory in these options. This provides support for Yarn PnP as well as reducing the complexity of the options especially for monorepo setups. Relatively located files will take precedence over packages if they exist. This precedence provides backwards compatibility with existing configurations.
Before :
`"styles": ["../node_modules/bootstrap/dist/css/bootstrap.css"]`
After:
`"styles": ["bootstrap/dist/css/bootstrap.css"]`
With this change we configure HMR internally and therefore users which want to use basic HMR functionality will not longer be required to change their application code.
This is important because previously a lot of users missed out on HMR or reported a broken behaviour. This also gives novice users a better chance to appreciate HMR and Angular because of the zero effort required to use HMR.
Closes#17324
The test was previously run only in Ivy mode but with VE specific test case files. The test now also enables strict templates to ensure template type checking files are properly excluded.
BREAKING CHANGE:
Deprecated `TestLogger` has been removed. Use `logging` API from `'@angular-devkit/core'` instead.
**Note:** this change doesn't effect application developers.