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 @@ -407,7 +407,7 @@ export class PrepareController extends EventEmitter {
407407 const dependencies = this . $nodeModulesDependenciesBuilder
408408 . getProductionDependencies (
409409 projectData . projectDir ,
410- projectData . ignoredDependencies ,
410+ projectData . getIgnoredDependencies ( platformData . platformNameLowerCase ) ,
411411 )
412412 . filter ( ( dep ) => dep . nativescript ) ;
413413 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 @@ -365,6 +365,34 @@ export class ProjectData implements IProjectData {
365365 return identifier ;
366366 }
367367
368+ public getIgnoredDependencies ( platform ?: string ) : string [ ] {
369+ const ignored = this . nsConfig ?. ignoredNativeDependencies ?? [ ] ;
370+ if ( ! platform || ! this . nsConfig ) {
371+ return ignored ;
372+ }
373+
374+ switch ( platform . toLowerCase ( ) ) {
375+ case constants . PlatformTypes . ios :
376+ return ignored . concat (
377+ this . nsConfig . ios ?. ignoredNativeDependencies ?? [ ] ,
378+ ) ;
379+ case constants . PlatformTypes . catalyst :
380+ return ignored . concat (
381+ this . nsConfig . catalyst ?. ignoredNativeDependencies ?? [ ] ,
382+ ) ;
383+ case constants . PlatformTypes . visionos :
384+ return ignored . concat (
385+ this . nsConfig . visionos ?. ignoredNativeDependencies ?? [ ] ,
386+ ) ;
387+ case constants . PlatformTypes . android :
388+ return ignored . concat (
389+ this . nsConfig . android ?. ignoredNativeDependencies ?? [ ] ,
390+ ) ;
391+ default :
392+ return ignored ;
393+ }
394+ }
395+
368396 private getProjectType ( ) : string {
369397 let detectedProjectType = _ . find (
370398 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 @@ -111,7 +111,9 @@ export class ProjectChangesService implements IProjectChangesService {
111111 this . $nodeModulesDependenciesBuilder
112112 . getProductionDependencies (
113113 projectData . projectDir ,
114- projectData . ignoredDependencies
114+ projectData . getIgnoredDependencies (
115+ platformData . platformNameLowerCase ,
116+ )
115117 )
116118 . filter (
117119 ( 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 ,
You can’t perform that action at this time.
0 commit comments