Parcel with gh-pages
See original GitHub issue🐛 bug report
🎛 Configuration (.babelrc, package.json, cli command)
{
"name": "parcel-react-example",
"license": "MIT",
"scripts": {
"start": "cross-env NODE_ENV=development parcel index.html ",
"build": "cross-env NODE_ENV=production parcel build index.html --public-url ./",
"predeploy": "yarn build",
"deploy": "gh-pages -d dist"
},
"homepage": "http://stychu.github.io/testAldente",
"dependencies": {
"autoprefixer": "^7.2.1",
"babel-preset-react-app": "^3.1.0",
"gh-pages": "^1.1.0",
"parcel-bundler": "^1.4.1",
"react": "^16.2.0",
"react-dom": "^16.2.0"
},
"postcss": {
"modules": false,
"plugins": {
"autoprefixer": {
"browsers": [
">1%",
"last 4 versions",
"Firefox ESR",
"not ie < 9"
],
"flexbox": "no-2009"
}
}
},
"devDependencies": {
"cross-env": "^5.1.1"
}
}
{
"presets": ["react-app"]
}
🤔 Expected Behavior
Basically, I wanted to publish simple react app to the GitHub pages with a usage of a parcel. Unfortunately, each time I try, app doesn’t get published. I mean it does get published correctly to the repo and gh-pages branch but I can’t see the app on homepage screen. I can’t find a solution to this. Im not sure if this is related strictly to the parcel build or I did something wrong… After running parcel build
I can open my index.html from /dist
and the app is working fine so it should work also on the gh-pages but it doesn’t…
When I try this with the react-app-cli which is using webpack everything works just fine.
😯 Current Behavior
App doesn’t update/run correctly after publishing to gh-pages.
💁 Possible Solution
🔦 Context
I want working app on gh-pages that is build with a parcel.
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 1.4.1 |
Node | v6.10.0 |
npm/Yarn | 5.3.0/1.1.0 |
Operating System | Linux |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:13
@stychu I’ve looked into your repo at https://github.com/stychu/testAldente/tree/gh-pages Please check the settings that this branch ‘gh-pages’ is the one for github pages to serve from. Then try again with
parcel build index.html --public-url /testAldente/
I hope it works.@stychu sorry that was just an example brought from the official Parcel website. Looking further on what you posted, I think the argument for the public-url option should be something like http://stychu.github.io/testAldente/
Please try this:
parcel build index.html --public-url http://stychu.github.io/testAldente/