Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.Create a github repo(It using github for free, then create a public repo).
- 2.Create a "gh-pages" branch
- 3.Clone it on local machine.
- 4.checkout to gh-pages branch
- 5.`npm init -y` in that local repo
- 6.`npm install --save-dev parcel-bundler` install parcel as dev dependency.
- 7. Add .html, .css and .js files.
- 8. Lets add npm script for bundling with parcel js.
- 9. `"start": "parcel src/index.html"`
- Now we want to push code in github pages
- 10.`npm install --save-dev gh-pages` install gh-pages as dev dependency.
- 11. add below scripts -
- `"build": "parcel build src/index.html",
- "predeploy": "rm -rf dist && parcel build src/index.html --no-source-maps --public-url ./",
- "deploy": "gh-pages -d dist"`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement