File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ export abstract class ProjectData {
2525 abstract projectIdentifiers ?: Mobile . IProjectIdentifier ;
2626 abstract dependencies : any ;
2727 abstract ignoredDependencies ?: string [ ] ;
28+
29+ abstract getIgnoredDependencies ( platform ?: string ) : string [ ] ;
2830 abstract devDependencies : IStringDictionary ;
2931 abstract appDirectoryPath : string ;
3032 abstract appResourcesDirectoryPath : string ;
Original file line number Diff line number Diff line change @@ -404,7 +404,7 @@ export class PrepareController extends EventEmitter {
404404 const dependencies = this . $nodeModulesDependenciesBuilder
405405 . getProductionDependencies (
406406 projectData . projectDir ,
407- projectData . ignoredDependencies ,
407+ projectData . getIgnoredDependencies ( platformData . platformNameLowerCase ) ,
408408 )
409409 . filter ( ( dep ) => dep . nativescript ) ;
410410 const pluginsNativeDirectories = dependencies . map ( ( dep ) =>
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ interface IProjectService {
101101
102102interface INsConfigPlaform {
103103 id ?: string ;
104+ ignoredNativeDependencies ?: string [ ] ;
104105}
105106
106107interface IOSSPMPackageBase {
Original file line number Diff line number Diff line change @@ -348,6 +348,30 @@ export class ProjectData implements IProjectData {
348348 return identifier ;
349349 }
350350
351+ public getIgnoredDependencies ( platform ?: string ) : string [ ] {
352+ const ignored = this . nsConfig ?. ignoredNativeDependencies ?? [ ] ;
353+ if ( ! platform || ! this . nsConfig ) {
354+ return ignored ;
355+ }
356+
357+ switch ( platform . toLowerCase ( ) ) {
358+ case constants . PlatformTypes . ios :
359+ return ignored . concat (
360+ this . nsConfig . ios ?. ignoredNativeDependencies ?? [ ] ,
361+ ) ;
362+ case constants . PlatformTypes . visionos :
363+ return ignored . concat (
364+ this . nsConfig . visionos ?. ignoredNativeDependencies ?? [ ] ,
365+ ) ;
366+ case constants . PlatformTypes . android :
367+ return ignored . concat (
368+ this . nsConfig . android ?. ignoredNativeDependencies ?? [ ] ,
369+ ) ;
370+ default :
371+ return ignored ;
372+ }
373+ }
374+
351375 private getProjectType ( ) : string {
352376 let detectedProjectType = _ . find (
353377 ProjectData . PROJECT_TYPES ,
Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ export class PluginsService implements IPluginsService {
359359 dependencies ||
360360 this . $nodeModulesDependenciesBuilder . getProductionDependencies (
361361 projectData . projectDir ,
362- projectData . ignoredDependencies ,
362+ projectData . getIgnoredDependencies ( platform ) ,
363363 ) ;
364364
365365 if ( _ . isEmpty ( dependencies ) ) {
Original file line number Diff line number Diff line change @@ -109,7 +109,9 @@ export class ProjectChangesService implements IProjectChangesService {
109109 this . $nodeModulesDependenciesBuilder
110110 . getProductionDependencies (
111111 projectData . projectDir ,
112- projectData . ignoredDependencies
112+ projectData . getIgnoredDependencies (
113+ platformData . platformNameLowerCase ,
114+ )
113115 )
114116 . filter (
115117 ( dep ) =>
Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ export class NodeModulesBuilder implements INodeModulesBuilder {
2020 } : IPrepareNodeModulesData ) : Promise < void > {
2121 let dependencies = this . $nodeModulesDependenciesBuilder . getProductionDependencies (
2222 projectData . projectDir ,
23- projectData . ignoredDependencies
23+ projectData . getIgnoredDependencies (
24+ platformData . platformNameLowerCase ,
25+ )
2426 ) ;
2527 dependencies = await platformData . platformProjectService . beforePrepareAllPlugins (
2628 projectData ,
Original file line number Diff line number Diff line change @@ -720,6 +720,10 @@ export class ProjectDataStub implements IProjectData {
720720 return "" ;
721721 }
722722
723+ public getIgnoredDependencies ( platform ?: string ) : string [ ] {
724+ return [ ] ;
725+ }
726+
723727 public getAppDirectoryPath ( projectDir ?: string ) : string {
724728 if ( ! projectDir ) {
725729 projectDir = this . projectDir ;
You can’t perform that action at this time.
0 commit comments