Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement custom module federation config path in angular/src/builders/utilities/module-federation.ts #15739

Closed
1 task done
peppoasap opened this issue Mar 17, 2023 · 3 comments · Fixed by #17876
Closed
1 task done
Assignees
Labels
outdated scope: angular Issues related to Angular support in Nx type: feature

Comments

@peppoasap
Copy link

Description

Currently, the Nx Angular Module Federation Dev Server when calling the getStaticRemotes method use the default path for the module-federation.config(in project root folder 'module-federation.config.js'), which can be inconvenient in certain scenarios and make unable to use a typescript config file(like my module-federation.config.ts). It would be helpful to have the ability to specify a custom path for the module-federation.config file when starting the dev server. This would allow users to load the config from a specific location(ex. a libs containing all the manifest) and to use a ts config.

Motivation

Implementing a custom module-federation.config path in the Nx Angular Module Federation Dev Server would provide more flexibility, capabilities to use typed config file and convenience for users who need to work with it in non-standard scenarios.

Suggested Implementation

  • Adding a customModuleFederationConfig?: object; options in builders/module-federation-dev-server/schema.d.ts and schema.json;
"customModuleFederationConfig": {
        "type": "object",
        "description": "use a custom module federation config file",
        "properties": {
              "path": { "type": "string" }
         }
}
  • Change the getStaticRemotes method to use the new path when declaring const mfConfigPath.
@AgentEnder AgentEnder added the scope: angular Issues related to Angular support in Nx label Mar 20, 2023
@Coly010
Copy link
Contributor

Coly010 commented Mar 24, 2023

If you're willing to implement this, feel free to open a PR.

There's also a chance you'll need to ensure the executor/builder will be able to handle the import of TS file correctly.

@peppoasap
Copy link
Author

Okay thanks. I will start to work on it as soon as possibile, hope to do my best to contribute to the project :)

peppoasap pushed a commit to peppoasap/nx that referenced this issue Mar 28, 2023
added an option to make the module-federation-dev-server and ssr builder accept a custom path for the module federation config file.

Closes nrwl#15739
peppoasap added a commit to peppoasap/nx that referenced this issue Apr 13, 2023
added an option to make the module-federation-dev-server and ssr builder accept a custom path for the module federation config file.

Closes nrwl#15739
feat(angular): custom mf config path and ts support

added a path to retrieve the module-federation.config file and to support typescript config file
Closes nrwl#15739
docs(angular): autogenerated docs for custom mf config path


fix(angular): runned nx format after custom mf config path changes
peppoasap added a commit to peppoasap/nx that referenced this issue Apr 13, 2023
added an option to make the module-federation-dev-server and ssr builder accept a custom path for the module federation config file.

added a path to retrieve the module-federation.config file and to support typescript config file

Closes nrwl#15739
peppoasap added a commit to peppoasap/nx that referenced this issue Apr 18, 2023
Handle TS mf config file in Webpack withModuleFederation stable + renamed schema prop. and fixes from review on PR nrwl#16299

Close(nrwl#15739)
peppoasap added a commit to peppoasap/nx that referenced this issue Apr 18, 2023
Handle TS mf config file in Webpack withModuleFederation stable + renamed schema prop. and fixes from review on PR nrwl#16299

Close(nrwl#15739)
peppoasap added a commit to peppoasap/nx that referenced this issue Apr 19, 2023
added an option to make the module-federation-dev-server and ssr builder accept a custom path for the module federation config file.

added a path to retrieve the module-federation.config file and to support typescript config file

Closes nrwl#15739
peppoasap added a commit to peppoasap/nx that referenced this issue Apr 19, 2023
Handle TS mf config file in Webpack withModuleFederation stable + renamed schema prop. and fixes from review on PR nrwl#16299

Close(nrwl#15739)
@Coly010 Coly010 self-assigned this Jun 30, 2023
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: angular Issues related to Angular support in Nx type: feature
Projects
None yet
3 participants