Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda