module-federation-examples | Implementation examples of module federation | OAuth library
kandi X-RAY | module-federation-examples Summary
kandi X-RAY | module-federation-examples Summary
This repository is to showcase examples of how Webpack 5's new Module Federation can be used.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of module-federation-examples
module-federation-examples Key Features
module-federation-examples Examples and Code Snippets
Community Discussions
Trending Discussions on module-federation-examples
QUESTION
I'm working on a new project using Angular 11 and Webpack 5. I am basing my work on Manfred Steyer's Module Federation Plugin Example repo, which uses Angular CLI. I can't figure out how to share a singleton service from a shared local Angular library between my two apps.
I'll do my best to explain my setup.. Real sorry about how long this is going to be.
Simplified File Structure ...ANSWER
Answered 2020-Oct-28 at 16:22TL;DR
- Make sure any module dependencies your shared services have are also shared.
- Make sure you've structured your shared config correctly in
webpack.config.ts
I'm going to note that my project is an NX Monorepo using Angular CLI. I'm using (at the moment) Angular 11.0.0-next and Webpack 5, which is only available as an opt-in with ng11 at the time of writing.
If you're using path aliases in your tsconfig, you are used to importing local libraries like "@common/my-lib", but you can't share modules by alias in your webpack config. Furthermore, if you're on NX, your linting will complain if you import from absolute or relative library paths, so there is a disconnect between what Webpack wants, and what nx/tslint wants.
In my project I have some library aliases like the following
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install module-federation-examples
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page