8
8
9
9
const fs = require ( 'fs' ) ;
10
10
const path = require ( 'path' ) ;
11
+ const { packages } = require ( '../lib/packages' ) ;
11
12
12
13
module . exports = {
13
14
baseDir : '../' ,
@@ -22,26 +23,14 @@ module.exports = {
22
23
* Custom module resolver that maps specifiers for local packages folder.
23
24
* This ensures that cross package/entry-point dependencies can be detected.
24
25
*/
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 ] ) ;
38
27
39
28
function resolveModule ( specifier ) {
40
29
let localSpecifierPath ;
41
30
42
31
for ( const [ key , value ] of LOCAL_MAPPINGS ) {
43
32
if ( specifier . startsWith ( key ) ) {
44
- localSpecifierPath = path . join ( __dirname , specifier . replace ( key , value ) ) ;
33
+ localSpecifierPath = specifier . replace ( key , value ) ;
45
34
break ;
46
35
}
47
36
}
0 commit comments