After setting up a private hosted npm registry (verdaccio) and attempting to publish our Angular libraries to it, I encountered an issue that I'm seeking help with. When I build and attempt to publish using the following command:
npm publish ./dist/{lib-name}
I receive the following error message:
Trying to publish a package that has been compiled by Ivy in full compilation mode. This is not allowed. Please delete and rebuild the package with Ivy partial compilation mode, before attempting to publish
I understand that it's recommended for angular libraries to support both View Engine and Ivy. To achieve this, I updated our tsconfig for the production build as follows:
{
...
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
However, this change results in a multitude of compile errors, including:
error NG3003: One or more import cycles would need to be created to compile this component, which is not supported by the current compiler configuration.
Due to time constraints, refactoring all our libraries immediately isn't feasible.
I'm having difficulty understanding why our library should support older Angular versions when all our projects are already on Angular 15. While I could technically bypass the error message and publish to our npm registry, I want to make sure I'm not overlooking a fundamental aspect of the Angular compiler.
Is there a way to opt out of the error message, or is there a better solution to this issue that I might be missing? Any insights or guidance would be greatly appreciated.