nx/packages/react/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.md
Isaac Mann 8b11d8bfe5
docs(core): add migrations docs for 20.x (#30186)
Adds migration docs for all 20.0 through 20.4 migrations
2025-02-27 15:58:41 -05:00

717 B

Add Module Federation Env Var to Target Defaults

Add NX_MF_DEV_REMOTES to inputs for task hashing when @nx/webpack:webpack or @nx/rspack:rspack is used for Module Federation.

Sample Code Changes

{% tabs %} {% tab label="Before" %}

{
  "targetDefaults": {
    "@nx/webpack:webpack": {
      "inputs": ["^build"]
    }
  }
}

{% /tab %} {% tab label="After" %}

{
  "targetDefaults": {
    "@nx/webpack:webpack": {
      "cache": true,
      "dependsOn": ["^build"],
      "inputs": [
        "^build",
        {
          "env": "NX_MF_DEV_REMOTES"
        }
      ]
    }
  }
}

{% /tab %} {% /tabs %}