-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module-federation): add comment to generated module federation c…
…onfig explaining usage of external remotes (nrwl#20177)
- Loading branch information
Showing
7 changed files
with
193 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
packages/angular/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
module.exports = { | ||
name: '<%= name %>',<% if(type === 'host') { %> | ||
/** | ||
* To use a remote that does not exist in your current Nx Workspace | ||
* You can use the tuple-syntax to define your remote | ||
* | ||
* remotes: [['my-external-remote', 'https://nx-angular-remote.netlify.app']] | ||
* | ||
* You _may_ need to add a `remotes.d.ts` file to your `src/` folder declaring the external remote for tsc, with the | ||
* following content: | ||
* | ||
* declare module 'my-external-remote'; | ||
* | ||
*/ | ||
remotes: [<% remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); %>]<% } %><% if(type === 'remote') { %> | ||
exposes: {<% if(standalone) { %> | ||
'./Routes': '<%= projectRoot %>/src/app/remote-entry/entry.routes.ts',<% } else { %> | ||
'./Module': '<%= projectRoot %>/src/app/remote-entry/entry.module.ts',<% } %> | ||
},<% } %> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...ges/react/src/generators/host/files/module-federation/module-federation.config.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters