Sharing Angular Modules with Ivy Compilation Requirement Between Two Projects

51 views Asked by At

Question:

I have two separate Angular projects that share certain common modules. We've established a private GitHub NPM repository to manage these shared resources. However, one of these common module sets necessitates full Ivy compilation to function properly, making it unsuitable for publication on NPM. What's the best approach for sharing these modules between the two projects?

Things I've Tried:

Packaging and Raw Files Upload: I attempted to package and upload the raw module files to the NPM package. However, I've been unable to successfully link and make them work in a debugging scenario.

Rebuilding Ivy for Partial Mode: Another approach I explored was rebuilding the full Ivy code to work with partial mode. However, it seemed like a substantial amount of work and it also disrupted the modularity and reusability that I initially had.

Given these attempts, I'm seeking guidance on the most effective approach to share these Ivy-dependent common modules between my two Angular projects while maintaining their Ivy compilation requirement and ensuring modularity and ease of use. Any suggestions or advice would be greatly appreciated.

1

There are 1 answers

1
GreyBeardedGeek On

According to the documentation, partial-ivy is the only way to guarantee portability.