G3 is now using RXJS version 7 which makes it possible for the CLI to also be updated to RXJS 7.
NB: this change does not remove all usages of the deprecated APIs.
Closes#24371
Prepares the `@angular-devkit/build-webpack` package for the eventual change of enabling the
TypeScript `useUnknownInCatchVariables` option. This option provides additional
code safety by ensuring that the catch clause variable is the proper type before
attempting to access its properties. Similar changes will be needed in the other
packages in the repository prior to enabling `useUnknownInCatchVariables`.
Webpack-dev-server doesn't handle concurrency very well. When using port 0, and 2 processes start at the same time, they end up being given the same port. The main reason for the issue is that it find a free port, put only uses at a later stage.
BREAKING CHANGE:
Support for `webpack-dev-server` version 3 has been removed. For more information about the migration please see: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
Note: this change only affects users depending on `@angular-devkit/build-webpack` directly.
With this change we emit the compilation result when the compilation is closed, when the compilation is not in watch mode.
This is needed so that when persistent caching is enabled and architect promise API is used (`.result`) instead of `.output` we wait for the cache to be written prior to terminating the process/resolving the result promise.
The `result` API currently, takes the first emit 4f9df9f4a4/packages/angular_devkit/architect/src/schedule-by-name.ts (L118-L120)Closes#21419
The `esModuleInterop` option is recommended to be enable by TypeScript and corrects several assumptions TypeScript would otherwise make when importing CommonJS files.
This option change helps ensure compatibility as packages move towards ESM.
Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop
Until we depend on `webpackStats` in the browser builder we should only included the required stats.
The below are the needed stats;
```
all: false,
colors: true,
hash: true,
timings: true,
chunks: true,
builtAt: true,
warnings: true,
errors: true,
assets: true,
ids: true,
entrypoints: true,
```
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
The `@angular-devkit/build-webpack` package now officially supports Webpack 5.
Webpack 4 support is temporarily maintained while the remainder of the tooling is transitioned.
The package's `@angular-devkit/core` dependency is only used in non-test code to provide a single type which is no longer needed with the latest architect.
This change adds the output path for the Webpack build directly to the result of the builder. This removes one of the reasons for using the Webpack JSON stats object which is expensive to generate.
The Webpack `Stats.toJson` function can be expensive. A new programmatic option is now available (`shouldProvideStats`) which can be used to control whether the `webpackStats` property on the builder output object is present. For backwards compatibility, the option is currently enabled by default.
With Webpack 5, passing the watch configuration option into the `webpack` factory function will cause the Webpack compiler to assume it should immediately start watching which requires a callback to be passed as well. Since the execution of the compiler is handled later in the process, a callback at the compiler creation stage is undesirable and could result in potentially breaking changes to accomplish.
This change removes some unneeded casts and provides support for building against Webpack 5. Webpack 5 typings currently do not contain certain types (for example, `Compiler.Handler`). Webpack 5 also uses `Set` in many places instead of arrays.
It seems that this is causing issues with proxy config and IIS with Windows authentication, for now we remove the `ArchitectPlugin` since it's not being used.
Fixes#14595
We need to consider the name when deduping files because a file such as `runtime.js` can be under multiples names because this file is a dependency of multiple entrypoints
Entrypoints might have other files associate with them such as runtime.js, it is is paramount to keep the relation between them especially when this result is needed to generate an index file
With this change the builder will report the emitted chunks and assets after the compilation, this is needed for deferential loading so that we can build an index from the outputs of multiple builds