Skip to content

CLI's checkForChanges method should not check all node_modules #4647

Closed
@rosen-vladimirov

Description

@rosen-vladimirov

Is your feature request related to a problem? Please describe.
CLI's watcher for node_modules should watch only the plugin's native files. With changes for 6.0.0 release, webpack will automatically watch all required files, even when they are from node_modules. When a change in some of the native files is applied, CLI's watcher will be triggered. In this case, the logic of CLI will be triggered to check if the node_modules are modified. It will list all files in node_modules just to determine if there's a change in any of them. Instead of listing all node_modules, CLI should check only the nativescript plugins and their platforms/<platform> directories.

Describe the solution you'd like
Change this code to list only <project dir>/node_modules/<nativescript plugin name>/platforms/<current platform> directories.

this._changesInfo.nativeChanged = projectChangesOptions.skipModulesNativeCheck ? false : this.containsNewerFiles(
path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME),
path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME, "tns-ios-inspector"),
projectData,
this.fileChangeRequiresBuild);

Describe alternatives you've considered
Refactor the whole checkForChanges logic, but this requires more time.

Additional context

Metadata

Metadata

Assignees

Labels

buildDescribes issues related to build operationsrunDescribes issues related to run commandwebpack

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions