Skip to content

[rush] Extend incremental build ignore capabilities (per command, by monorepo/workspace devDependencies) #4238

Open

Description

Summary

We have various custom commands leveraging the build cache. However, some of those commands do not actually depend on all devDependencies in package.json. I.e. when a dev dependency (e.g. another project in the monorepo) changes, all commands cache is invalidated even though we know it is not relevant for some of those commands.

We can ignore specific files in each project to be considered ignored for changes. However, we cannot do that for monorepo projects in dependencies. I believe it should be considered for devDependencies only though.

A small detail relevant for both - ignoring files and ignoring dependencies - is that the current file ignore works for all commands. It would be nice to have the possibility ignore files (and devDependencies) independently for each command (but keeping the common configuration for all commands).

E.g. rush-project.json

{
  "incrementalBuildIgnoredGlobs": [
    "**/*.md"
  ],

  "incrementalBuildIgnoredDevDependencies": [
    "@rushstack/foo"
  ],

  "operationSettings": [
    ...
    {
      "operationName": "foo",
      ...
      "incrementalBuildIgnoredGlobs": [
        "**/*.md", // Notice this is duplicated and not inherited. Inheritance would make it complicated to make an exception including generally ignored files
        "**/*.json"
      ],

      "incrementalBuildIgnoredDevDependencies": [
        "@rushstack/bar", // Notice the dependency `@rushstack/foo` is not ignored here
      ],
    },
    ...
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is asking for a new feature or design changeneeds more infoWe can't proceed because we need a better repro or an answer to a question

    Type

    No type

    Projects

    • Status

      General Discussions

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions