I forked an angular lib, added a new subfolder in projects/keycloak-angular/src/lib/core which has a .js and .d.ts file that exports a namespace. It is imported into two existing files to expand functionality.
When running npm run build
I get the following error:
Building Angular Package
Building entry point 'keycloak-angular'
Rendering Stylesheets
Rendering Templates
Compiling TypeScript sources through ngc
Bundling to FESM2015
BUILD ERROR
Could not resolve '../keycloak-authz/keycloak-authz' from dist/keycloak-angular/esm2015/lib/core/services/keycloak.service.js
Error: Could not resolve '../keycloak-authz/keycloak-authz' from dist/keycloak-angular/esm2015/lib/core/services/keycloak.service.js
at error (/Users/cen/git/petrol-keycloak-angular/node_modules/rollup/dist/rollup.js:199:15)
at /Users/cen/git/petrol-keycloak-angular/node_modules/rollup/dist/rollup.js:20784:25
The error is exactly what it says: it cannot resolve the import because the newly added files are not copied to dist folder. Vscode "intellisense" resolves the imports just fine in the src folder.
I checked tsconfig, angular config and ng-package config to try and figure out if the existing files are specified somehow for inclusion but I can't find anything. I also found this issue which sounds very similar to mine and might be connected.
Why are my additions left out from the build/package phase?