Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rosen-vladimirov opened this issue May 26, 2019 · 1 comment
Closed
Assignees
Labels
build Describes issues related to build operations run Describes issues related to run command webpack
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

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

@rosen-vladimirov rosen-vladimirov added webpack build Describes issues related to build operations run Describes issues related to run command labels May 26, 2019
@rosen-vladimirov rosen-vladimirov added this to the 6.0.0 milestone May 26, 2019
@adrian-niculescu
Copy link

This is only desirable during the development of 1 plugin and would cripple other development flows.
The current behaviour should be kept (and be configurable maybe) to allow:

  • debugging of any node_modules file://... dependency.
  • debugging of a plugin that is used inside of another plugin (recently needed this with a a permissions management plugin used inside another one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Describes issues related to build operations run Describes issues related to run command webpack
Projects
None yet
Development

No branches or pull requests

4 participants