@@ -35,21 +35,21 @@ export class TnsModulesCopy {
35
35
}
36
36
37
37
private copyDependencyDir ( dependency : IDependencyData ) : void {
38
- if ( dependency . depth === 0 ) {
39
- let isScoped = dependency . name . indexOf ( "@" ) === 0 ;
40
- let targetDir = this . outputRoot ;
38
+ const targetPackageDir = path . join ( this . outputRoot , dependency . name ) ;
41
39
42
- if ( isScoped ) {
43
- targetDir = path . join ( this . outputRoot , dependency . name . substring ( 0 , dependency . name . indexOf ( "/" ) ) ) ;
44
- }
40
+ shelljs . mkdir ( "-p" , targetPackageDir ) ;
45
41
46
- shelljs . mkdir ( "-p" , targetDir ) ;
47
- shelljs . cp ( "-Rf" , dependency . directory , targetDir ) ;
42
+ let isScoped = dependency . name . indexOf ( "@" ) === 0 ;
48
43
49
- // remove platform-specific files (processed separately by plugin services)
50
- const targetPackageDir = path . join ( isScoped ? this . outputRoot : targetDir , dependency . name ) ;
51
- shelljs . rm ( "-rf" , path . join ( targetPackageDir , "platforms" ) ) ;
44
+ if ( isScoped ) {
45
+ // copy module into tns_modules/@scope /module instead of tns_modules/module
46
+ shelljs . cp ( "-Rf" , dependency . directory , path . join ( this . outputRoot , dependency . name . substring ( 0 , dependency . name . indexOf ( "/" ) ) ) ) ;
47
+ } else {
48
+ shelljs . cp ( "-Rf" , dependency . directory , this . outputRoot ) ;
52
49
}
50
+
51
+ // remove platform-specific files (processed separately by plugin services)
52
+ shelljs . rm ( "-rf" , path . join ( targetPackageDir , "platforms" ) ) ;
53
53
}
54
54
}
55
55
0 commit comments