Skip to content

Commit 8f614d5

Browse files
committed
fix: temporary workaround for TS bug with UMDs
The TS bug is microsoft/TypeScript#36780. The workaround is needed because `ts_library` emits UMDs currently. This will change with bazelbuild/rules_typescript#492 and bazel-contrib/rules_nodejs#1687.
1 parent 459c950 commit 8f614d5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/angular_devkit/architect/node/node-modules-architect-host.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ export class WorkspaceNodeModulesArchitectHost implements ArchitectHost<NodeModu
143143
}
144144

145145
async loadBuilder(info: NodeModulesBuilderInfo): Promise<Builder> {
146-
const builder = (await import(info.import)).default;
146+
const f1 = info.import;
147+
const builder = (await import(f1)).default;
147148
if (builder[BuilderSymbol]) {
148149
return builder;
149150
}

packages/angular_devkit/architect/testing/testing-architect-host.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ 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+
const f1 = packageName + '/package.json';
40+
const packageJson = await import(f1);
4041
if (!('builders' in packageJson)) {
4142
throw new Error('Invalid package.json, builders key not found.');
4243
}
@@ -56,8 +57,10 @@ export class TestingArchitectHost implements ArchitectHost {
5657
const b = builders[builderName];
5758
// TODO: remove this check as v1 is not supported anymore.
5859
if (!b.implementation) { continue; }
59-
const handler = (await import(builderJsonPath + '/../' + b.implementation)).default;
60-
const optionsSchema = await import(builderJsonPath + '/../' + b.schema);
60+
const f2 = builderJsonPath + '/../' + b.implementation;
61+
const handler = (await import(f2)).default;
62+
const f3 = builderJsonPath + '/../' + b.schema;
63+
const optionsSchema = await import(f3);
6164
this.addBuilder(`${packageJson.name}:${builderName}`, handler, b.description, optionsSchema);
6265
}
6366
}

0 commit comments

Comments
 (0)