Skip to content

Allow custom cwd to generate the types #3338

@nachoaldamav

Description

@nachoaldamav

Clear and concise description of the problem

Right now, if the plugin is running in a directory where Typescript is not installed, the types generation fails. This feature could allow to specify a cwd where the user knows Typescript is installed.

Suggested solution

  • Add a new property inside ModuleFederationPluginOptions.dts called cwd.
  • In the DTS plugin, inside the compileTs function, use this new property in the cwd argument of execPromise.
  • Optionally, fallback to the dirname of remoteOptions.tsConfigPath.

Alternative

Forcing the cwd to be the direname of remoteOptions.tsConfigPath.

Additional context

When I have this issue, running tsc manually throws this error.
image (3)

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions