Use any of the commands:
- ng build
- ng build –prod
- ng build –prod –base-href /directory-name/sub-directory-name/
Create testing branch on github
- add normal git repository
- git branch gh-pages
- git push -u origin gh-pages
To push on the git repository
- git init
- git add origin
- git add .
- git commit -m “Initial Commit”
- git push -u origin master
- ng build –prod –base-href https://whateveruser.github.io/whateverprojectrepo/
- ngh
ng build –prod –base-href https://github.com/whateveruser/whateverprojectrepo/
Ref:
- https://www.youtube.com/watch?v=nxV3weqMzYo
.htaccess for production site
RewriteEngine on # Don't rewrite files or directories RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] # Rewrite everything else to index.html to allow html5 state links RewriteRule ^ index.html [L]