Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

113
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda