Angular 10.2.2
version.
I have created Angular library my-lib
using this page. In my library, I have devDependency
on one of the internal NPM packages my-comp.web
.
In my library I have imports
like below
import { MyWebModule } from "my-comp.web/sdk/angular";
import { myWeb } from "my-comp.web/sdk";
If I build this library using ng build
i.e. Ivy library
, create its NPM package and then use this NPM package in another Angular Application, this Application's build works fine.
Now Angular recommends to build libraries with Ivy
disabled, so when I build the same library code with ng build --prod
and use this library in application, I get below error while building this application.
ERROR in The target entry-point "my-lib" has missing dependencies:
- my-comp.web/sdk/angular
- my-comp.web/sdk
Application's package.json
has devDepencency
of my-comp.web
.
I have tried everything suggested on StackOverflow, including deleting node_modules
and re-install it, but nothing is working. May I know what am I missing here ?