Skip to content

Instantly share code, notes, and snippets.

@poonia
Created March 19, 2019 08:57
Show Gist options
  • Save poonia/7f6e688738b808d448adc0d4e8bef65a to your computer and use it in GitHub Desktop.
Save poonia/7f6e688738b808d448adc0d4e8bef65a to your computer and use it in GitHub Desktop.
gh-pages with parceljs
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"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment