@@ -11,13 +11,15 @@ export class NativeScriptPathTransformer extends UrlPathTransformer {
1111
1212 private targetPlatform : string ;
1313 private appDirPath : string ;
14+ private webRoot : string ;
1415
15- public setTransformOptions ( targetPlatform : string , appDirPath : string ) {
16+ public setTransformOptions ( targetPlatform : string , appDirPath : string , webRoot : string ) {
1617 this . targetPlatform = targetPlatform . toLowerCase ( ) ;
1718 this . appDirPath = appDirPath ;
19+ this . webRoot = webRoot ;
1820 }
1921
20- protected async targetUrlToClientPath ( webRoot : string , scriptUrl : string ) : Promise < string > {
22+ protected async targetUrlToClientPath ( scriptUrl : string ) : Promise < string > {
2123 if ( ! scriptUrl ) {
2224 return ;
2325 }
@@ -50,7 +52,7 @@ export class NativeScriptPathTransformer extends UrlPathTransformer {
5052 relativePath = relativePath . replace ( 'app' , this . appDirPath ) ;
5153 }
5254
53- let absolutePath = path . resolve ( path . join ( webRoot , relativePath ) ) ;
55+ let absolutePath = path . resolve ( path . join ( this . webRoot , relativePath ) ) ;
5456 let platformSpecificPath = this . getPlatformSpecificPath ( absolutePath ) ;
5557
5658 if ( platformSpecificPath ) {
@@ -59,7 +61,7 @@ export class NativeScriptPathTransformer extends UrlPathTransformer {
5961
6062 if ( isAndroid ) {
6163 // handle files like /data/data/internal/ts_helpers.ts
62- absolutePath = path . resolve ( path . join ( webRoot , 'platforms' , this . targetPlatform . toLowerCase ( ) , 'app' , 'src' , 'main' , 'assets' , relativePath ) ) ;
64+ absolutePath = path . resolve ( path . join ( this . webRoot , 'platforms' , this . targetPlatform . toLowerCase ( ) , 'app' , 'src' , 'main' , 'assets' , relativePath ) ) ;
6365 platformSpecificPath = this . getPlatformSpecificPath ( absolutePath ) ;
6466
6567 if ( platformSpecificPath ) {
0 commit comments