Skip to content

Commit adb92ac

Browse files
committed
build: refactor circular-deps-test.conf to use package.js file
This ensures that all packages are picked up. (cherry picked from commit 71731f2)
1 parent cdc7c22 commit adb92ac

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

packages/circular-deps-test.conf.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
const fs = require('fs');
1010
const path = require('path');
11+
const { packages } = require('../lib/packages');
1112

1213
module.exports = {
1314
baseDir: '../',
@@ -22,26 +23,14 @@ module.exports = {
2223
* Custom module resolver that maps specifiers for local packages folder.
2324
* This ensures that cross package/entry-point dependencies can be detected.
2425
*/
25-
const LOCAL_MAPPINGS = [
26-
['@angular-devkit/build-angular', 'angular_devkit/build_angular'],
27-
['@angular-devkit/architect', 'angular_devkit/architect'],
28-
['@angular-devkit/architect-cli', 'angular_devkit/architect_cli'],
29-
['@angular-devkit/benchmark', 'angular_devkit/benchmark'],
30-
['@angular-devkit/build-webpack', 'angular_devkit/build_webpack'],
31-
['@angular-devkit/core', 'angular_devkit/core'],
32-
['@angular-devkit/schematics', 'angular_devkit/schematics'],
33-
['@angular-devkit/schematics-cli', 'angular_devkit/schematics_cli'],
34-
['@angular/cli', 'angular/cli'],
35-
['@schematics/angular', 'schematics/angular'],
36-
['@ngtools/webpack', 'ngtools/webpack'],
37-
];
26+
const LOCAL_MAPPINGS = Object.entries(packages).map(([name, pkg]) => [name, pkg.root]);
3827

3928
function resolveModule(specifier) {
4029
let localSpecifierPath;
4130

4231
for (const [key, value] of LOCAL_MAPPINGS) {
4332
if (specifier.startsWith(key)) {
44-
localSpecifierPath = path.join(__dirname, specifier.replace(key, value));
33+
localSpecifierPath = specifier.replace(key, value);
4534
break;
4635
}
4736
}

0 commit comments

Comments
 (0)