You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that npmInstall only registers changes to the root package.json etc., but not to scripts/package.json etc.
So if I change a dependency in scripts/package.json, npmInstall might not run.
It would be nice if the npmInstall task could check for changes in package.json etc. in all workspaces defined in the root package.json as well.
Currently, we need this workaround:
npmInstall {
outputs.upToDateWhen {false}
}
I don't think the problem is related to our unusual project structure, but likely affects every situation where NPM workspaces are involved - NpmInstallTask just doesn't seem to consider changes to workspace files / npm files outside of nodeProjectDir at all.
The text was updated successfully, but these errors were encountered:
hosswald
changed the title
npmInstall does not detect monorepo changes
npmInstall does not detect monorepo workspace changes
Feb 14, 2024
hosswald
changed the title
npmInstall does not detect monorepo workspace changes
npmInstall ignores npm workspaces in up-to-date detection
Feb 14, 2024
We have a monorepo with multiple workspaces. The workspaces also reflect the gradle (sub)project structure.
Our project structure looks like this:
The root
package.json
definedscripts/
as a workspace:We apply the gradle-node-plugin in the
scripts/build.gradle
like this:The problem is that
npmInstall
only registers changes to the rootpackage.json
etc., but not toscripts/package.json
etc.So if I change a dependency in
scripts/package.json
,npmInstall
might not run.It would be nice if the
npmInstall
task could check for changes inpackage.json
etc. in all workspaces defined in the rootpackage.json
as well.Currently, we need this workaround:
I don't think the problem is related to our unusual project structure, but likely affects every situation where NPM workspaces are involved - NpmInstallTask just doesn't seem to consider changes to workspace files / npm files outside of
nodeProjectDir
at all.The text was updated successfully, but these errors were encountered: