Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
react-scripts build generates wrong path for sub folder

My application should be served at /sub-folder so in the package.json the homepage field is set to

"homepage": "/sub-folder/",

The production bundle generated by react-scripts build is placed inside the dist directory that looks like

/dist
  /static
    /js
      main.[hash].js
      ...
    asset-manifest.json
    index.html
    ...

However index.html is trying to load at the following path

<script defer="defer" src="/sub-folder/static/js/main.41ee4874.js">

and obviously fails and won't load anything.

What is wrong with my configuration?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I hope you are looking for it.

/ package.json
  "scripts": {
    "build": "BUILD_PATH='./sub-folder' react-scripts build",
    // ...
  },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!