Skip to content

@module-federation/enhanced/rspack dts-plugin should allow fetching remote types in NODE_ENV=production #3573

Closed as not planned
@Romasato

Description

@Romasato

Describe the bug

There was a recent change in dts-plugin (#3424, specifically 6e3afc6#diff-413f6fcd437fcf62434d7930b36d3e5a338425a44de46c95fe34428178921ed7R30) where the logic whether to fetch remote typings or not was hard-coded around NODE_ENV variable to fetch types only if NODE_ENV == development.

The new logic seems to conflict with the expectation that https://module-federation.io/configure/dts.html#extractremotetypes is the parameter that's supposed to act as a switch to enable fetching or not - independent of environment variables etc. the build is running in.

The change is now also blocking us in our project where we want to fetch the remote typings during builds in CI/CD and validate consumer MFE against provider MFEs to check early for potential incompatibilities.
In CI/CD envs NODE_ENV is always supposed to be set to production as recommended in https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production.

  • Any reason why types cannot be fetched when building in non-dev environment?
  • Is there any chance revert the logic?
  • Or maybe there is another way to work around this?

Thank you

Reproduction

As described in the ticket.

Used Package Manager

npm

System Info

Independent of system.

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions