Search code examples
angularprimengng2-bootstrap

PrimeNG: how to 'pack' or 'build' the project after making changes?


I use primeng in my angular application. I wanted to add some functionality to one of the components so I followed the instructions (https://github.com/primefaces/primeng/wiki/Building-From-Source) and got all of my changes to work. Now I want to package it up so I can install this modified branch in my application. How do I go about doing that?

I've done this before with ng2-bootstrap by running 'npm pack' and then installing the generated tar package in my application. I tried doing the same with primeng but my project errored because the primeng.js file wasn't there. I'm assuming I need to do it a different way but I don't know how and I don't have much webpack/gulp experience.


Solution

    1. Fork to your GitHub account
    2. Clone package
    3. Make a new branch
    4. Make changes to new branch

    Then run the following commands in order;

    npm install - Downloads the dependencies

    gulp build - Creates resource bundle for css

    npm run build-prod - Which runs the build scripts.

    You can then push this package to your own GitHub account and with a different branch name and run the following in your project you require the custom build:

    npm install git://github.com/<user>/<project>.git#<branch>
    

    Then whenever priming makes changes on the master you can merge them with your custom branch.