File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed
etc/api/angular_devkit/build_optimizer/src
packages/angular_devkit/build_optimizer Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ export declare function buildOptimizer(options: BuildOptimizerOptions): Transfor
3
3
export declare const buildOptimizerLoaderPath : string ;
4
4
5
5
export declare class BuildOptimizerWebpackPlugin {
6
- apply ( compiler : Compiler ) : void ;
6
+ apply ( compiler : Compiler | WebpackFourCompiler ) : void ;
7
7
}
8
8
9
9
export default function buildOptimizerLoader ( this : {
Original file line number Diff line number Diff line change 22
22
"webpack" : {
23
23
"optional" : true
24
24
}
25
+ },
26
+ "devDependencies" : {
27
+ "@types/webpack" : " ^4.41.22" ,
28
+ "webpack" : " 5.21.2"
25
29
}
26
30
}
Original file line number Diff line number Diff line change 5
5
* Use of this source code is governed by an MIT-style license that can be
6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
- import { Compiler } from 'webpack' ;
8
+ import { Compiler , WebpackFourCompiler } from 'webpack' ;
9
9
10
10
interface ModuleData {
11
11
resourceResolveData : { descriptionFileData ?: { typings ?: string } } ;
12
12
}
13
13
14
14
export class BuildOptimizerWebpackPlugin {
15
- apply ( compiler : Compiler ) {
16
- compiler . hooks . normalModuleFactory . tap ( 'BuildOptimizerWebpackPlugin' , nmf => {
15
+ apply ( compiler : Compiler | WebpackFourCompiler ) {
16
+ ( compiler as Compiler ) . hooks . normalModuleFactory . tap ( 'BuildOptimizerWebpackPlugin' , nmf => {
17
17
// tslint:disable-next-line: no-any
18
18
nmf . hooks . module . tap ( 'BuildOptimizerWebpackPlugin' , ( module , data ) => {
19
19
const { descriptionFileData } = ( data as ModuleData ) . resourceResolveData ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import * as webpack from 'webpack' ;
9
+ import { Compiler as webpack4Compiler } from '@types/webpack' ;
10
+
11
+ // Webpack 5 transition support types
12
+ declare module 'webpack' {
13
+ export type WebpackFourCompiler = webpack4Compiler ;
14
+ }
You can’t perform that action at this time.
0 commit comments