I’m looking to publish my component that is dependent on Ionic UI components to the NPM library so that it’s easily shareable between my projects.
I have found a couple of articles that cover this however they do not explain in any sort of detail what the process is to allow me to gain a better understanding of why I am doing something!!
So I have created an empty folder and I have run the npm init command to initialize my package.json file which gives me a very basic file that is fine itself. I have then copied my component files along with supporting classes and my module file into the src folder and changed all of my paths to ensure everything is reference-able.
I have then created index.ts file that exports my two components and my module.
So I think this is a start point, now at this point how do I know which dependencies should be configured within my package.json file. Obviously I can go through my .ts files and pull out the items I directly use but is this enough?
At this point I have no idea what I can do to see if everything is configured correctly or not, but if I run npm run publishPackage then I get the following error: -
sh: ngc: command not found
Anybody any ideas?
Ionic: Ionic CLI : 6.1.0 Utility: cordova-res : 0.9.0 native-run : 0.3.0 System: NodeJS : v12.14.1 npm : 6.13.7 OS : macOS Catalina