TIL_180713 Deploy on github page
Deploy on github page
- github support service for static application to show it
- It makes a ‘gh-pages’ branch to publish
- If want to keep original source code (before optimizing), need to push to master branch
Build to compress and optimize code for production
1$ yarn buildAdd ‘homepage’ field in package.json
1"homepage" : "http://myname.github.io/myapp",Build again
Add gh-pages
1$ yarn add --dev gh-pagesAdd blow script in package.json
1234567// ..."scripts": {// ..."predeploy": "npm run build","deploy": "gh-pages -d build"}Deploy it
1$ yarn run deployApp will be shown at http://myname.github.io/myapp