Skip to content

Commit

Permalink
Set the homepage Field in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjeetkumaritoutlook committed Dec 13, 2024
1 parent a4bde99 commit 17bcdaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ jobs:
with:
name: github-pages
path: build # The folder containing your build output

# Step 5: Deploy to GitHub Pages
#When React builds the app, it generates relative paths based on the homepage field. Without this field, the paths default to /, causing errors when served from a subpath like /repository-name.
#Set the homepage Field in package.json
#React assumes it is being served from the root of the domain (/), but GitHub Pages serves the app from a subpath like /repository-name.
# Step 5: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub
publish_dir: build

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "my-typescript",
"version": "0.1.0",
"homepage": "https://sanjeetkumaritoutlook.github.io/react-local-stenciljs",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
Expand Down

0 comments on commit 17bcdaf

Please sign in to comment.