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.
In the forked PrimeNG v5, package.json need to be updated with following lines to build and redistribute.
additions to package.json
"scripts": {
"build-components": "ngc -p tsconfig-release.json",
"build-assets": "gulp build-assets",
"build-styles": "node-sass src/assets/components -o src/assets/components",
"build-redistribute": "npm run build-components && npm run build-assets && npm run build-styles"
}
"devDependencies": {
"node-sass": "^4.5.3",
}
install node-sass and run the following command to build
npm run build-redistribute
Ref : https://forum.primefaces.org/viewtopic.php?p=159783#p159783
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With