Description
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
- Read the docs.
- Read the common issues list.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Module federation issue and not a framework-specific issue.
- The provided reproduction is a minimal reproducible example of the bug.