11import { Schema as BrowserBuilderSchema } from '@angular-devkit/build-angular/src/browser/schema' ;
22import { Bundler , BundlerContext , DevServer , DevServerContext , Target } from '@teambit/bundler' ;
33import { CACHE_ROOT } from '@teambit/legacy/dist/constants' ;
4- import { ComponentID } from '@teambit/component' ;
4+ import { Component , ComponentID } from '@teambit/component' ;
55import { PkgMain } from '@teambit/pkg' ;
66import { pathNormalizeToLinux } from '@teambit/legacy/dist/utils' ;
77import { Logger } from '@teambit/logger' ;
@@ -11,7 +11,6 @@ import {
1111 runTransformersWithContext ,
1212 WebpackBundler ,
1313 WebpackConfigMutator ,
14- WebpackConfigTransformContext ,
1514 WebpackConfigTransformer ,
1615 WebpackConfigWithDevServer ,
1716 WebpackDevServer ,
@@ -118,7 +117,7 @@ export abstract class AngularWebpack {
118117 }
119118
120119 // get the list of files for existing component compositions to include into the compilation
121- context . components . forEach ( component => {
120+ context . components . forEach ( ( component : Component ) => {
122121 let outputPath : string ;
123122
124123 if ( this . isBuildContext ( context ) ) {
@@ -189,11 +188,10 @@ export abstract class AngularWebpack {
189188 ) ;
190189 const configMutator = new WebpackConfigMutator ( config ) ;
191190
192- const transformerContext : WebpackConfigTransformContext = { mode : 'dev' } ;
193191 const afterMutation = runTransformersWithContext (
194192 configMutator . clone ( ) ,
195193 [ defaultTransformer , ...transformers ] ,
196- transformerContext
194+ { mode : 'dev' }
197195 ) ;
198196
199197 return new WebpackDevServer ( afterMutation . raw as WebpackConfigWithDevServer , this . webpack as any , this . webpackDevServer as any ) ;
@@ -212,7 +210,7 @@ export abstract class AngularWebpack {
212210
213211 const defaultConfig : any = await this . getWebpackConfig (
214212 context ,
215- context . targets . map ( ( target ) => target . entries ) . flat ( ) ,
213+ context . targets . map ( ( target : Target ) => target . entries ) . flat ( ) ,
216214 tsconfigPath ,
217215 rootPath ,
218216 this . webpackMain . logger ,
@@ -224,13 +222,12 @@ export abstract class AngularWebpack {
224222 configMutator . merge ( [ defaultConfig ] ) ;
225223
226224 const configs = this . createPreviewConfig ( context . targets ) ;
227- const transformerContext : WebpackConfigTransformContext = { mode : 'prod' } ;
228225 const mutatedConfigs = configs . map ( ( config : any ) => {
229226 const configMutator = new WebpackConfigMutator ( config ) ;
230227 const afterMutation = runTransformersWithContext (
231228 configMutator . clone ( ) ,
232229 [ defaultTransformer , ...transformers ] ,
233- transformerContext
230+ { mode : 'prod' }
234231 ) ;
235232 return afterMutation . raw ;
236233 } ) ;
0 commit comments