@@ -36,7 +36,11 @@ export class TestingArchitectHost implements ArchitectHost {
3636 this . _builderMap . set ( builderName , { builderName, description, optionSchema } ) ;
3737 }
3838 async addBuilderFromPackage ( packageName : string ) {
39- const packageJson = await import ( packageName + '/package.json' ) ;
39+ // f1 const is a temporary workaround for a TS bug with UMDs.
40+ // See microsoft/TypeScript#36780. Should be removed when
41+ // https://github.com/bazelbuild/rules_typescript/pull/492 goes in.
42+ const f1 = packageName + '/package.json' ;
43+ const packageJson = await import ( f1 ) ;
4044 if ( ! ( 'builders' in packageJson ) ) {
4145 throw new Error ( 'Invalid package.json, builders key not found.' ) ;
4246 }
@@ -56,8 +60,13 @@ export class TestingArchitectHost implements ArchitectHost {
5660 const b = builders [ builderName ] ;
5761 // TODO: remove this check as v1 is not supported anymore.
5862 if ( ! b . implementation ) { continue ; }
59- const handler = ( await import ( builderJsonPath + '/../' + b . implementation ) ) . default ;
60- const optionsSchema = await import ( builderJsonPath + '/../' + b . schema ) ;
63+ // f2 and f3 consts are a temporary workaround for a TS bug with UMDs.
64+ // See microsoft/TypeScript#36780. Should be removed when
65+ // https://github.com/bazelbuild/rules_typescript/pull/492 goes in.
66+ const f2 = builderJsonPath + '/../' + b . implementation ;
67+ const handler = ( await import ( f2 ) ) . default ;
68+ const f3 = builderJsonPath + '/../' + b . schema ;
69+ const optionsSchema = await import ( f3 ) ;
6170 this . addBuilder ( `${ packageJson . name } :${ builderName } ` , handler , b . description , optionsSchema ) ;
6271 }
6372 }
0 commit comments