简体   繁体   中英

Publish Angular 12 library built with ivy to npm

I have a requirement to upgrade a library to angular 12...I have done this. Compiling this library with ivy full compilation mode succeeds but it turns out you can't publish a library compiled this way to npm???

Setting "enableIvy":false and "compilationMode": "partial" as suggested in many posts throws the error

Compiling with Angular in legacy View Engine compilation mode. Angular structure loaded both synchronously and asynchronously

This error does not seem to have a definite solution??

How is someone supposed to keep current with their Angular version and publish their library to npm in this kind of environment?

For me Setting "enableIvy":false and "compilationMode": "partial" as suggested in many posts throws many recursive errors...I'm not sure why "compilationMode": "partial" works differently than "compilationMode": "full".

What I found was that I had inappropriately imported a component inside my library using public.api
public/api should only be used outside the library for importing...inside the librarary I made sure that I was doing direct imports of components and everything started compiling properly under "compilationMode": "partial"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM