Skip to content

Commit 0fe20bc

Browse files
committed
refactor(@angular-devkit/build-angular): additional webpack 5 type improvements
Additional support for building with Webpack 5.
1 parent 811966a commit 0fe20bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/angular_devkit/build_angular/src/webpack/plugins/common-js-usage-warn-plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import { isWebpackFiveOrHigher } from '../../utils/webpack-version';
1515
const CommonJsRequireDependency = require('webpack/lib/dependencies/CommonJsRequireDependency');
1616
const AMDDefineDependency = require('webpack/lib/dependencies/AMDDefineDependency');
1717

18-
// The below is extended because there are not in the typings
19-
interface WebpackModule extends compilation.Module {
18+
// The below is used to remain compatible with both Webpack 4 and 5
19+
interface WebpackModule {
2020
name?: string;
2121
rawRequest?: string;
2222
dependencies: WebpackModule[];

packages/angular_devkit/build_angular/src/webpack/plugins/optimize-css-webpack-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function hook(
3636
});
3737
} else {
3838
compilation.hooks.optimizeChunkAssets
39-
.tapPromise(PLUGIN_NAME, (chunks: compilation.Chunk[]) => {
39+
.tapPromise(PLUGIN_NAME, (chunks: Iterable<compilation.Chunk>) => {
4040
const files: string[] = [];
4141
for (const chunk of chunks) {
4242
if (!chunk.files) {

0 commit comments

Comments
 (0)