How To Deploy Angular 2 App On Github For Free

At First Install angular-cli ghpages

npm install -g angular-cli-ghpages
After installing next step is linking your repository. Run this command
ng build --prod --base-href "https://<user-name><repo>/" 
If You See Error Then ommit --prod and Run This Command
ng build --base-href "https://<user-name><repo>/" 
You can now see a dist folder in your angular 2 app directory. 
Upload all files of dist folder on github repository. 
Then From Settings Enable Github Pages. A link will be provided to you.
That's It.

Demo :
Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge.
    Blogger Comment
    Facebook Comment


Post a Comment