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

209
Visualizações
How to run Webpack project on apache server

I've got a project that runs fine in the dev server environment, but now I am trying to get it to run on an Apache server. I ran 'npm run build' on my package.json file ("build": "babel-node tools/build.js && npm run open:dist"), and it created a dist folder with the following files:

  • index.html
  • main.js
  • main.map.js
  • main.css
  • main.css.map

I placed this folder inside of the htdocs folder in my Apache directory. I double clicked on index.html hoping it would take me to the home page of the app, but nothing happens. Not even an error in the console.

Here's the index.html file I'm using:

<!DOCTYPE html>
<html lang="en"><head> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8"/>
    <title>Survey Builder</title>
    <link href="./dist/app/main.8286783e52fd295f2f9e5d678a8a2acd.css" rel="stylesheet">
    </head>
        <body>
            <div id="app">
            </div>
            <script type="text/javascript" src="./dist/app/main.66670fe7523b3b72f307.js"></script>
        </body>
</html>

Thanks a bunch in advance!

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I'll answer my own question.

*If you're using React and you're deploying on Apache, you need to know that the path where you place your files in Apache must be reflected in your React routes. So, if you place your production ready React files inside of a folder in your htdocs Apache directory, you must also reflect that path in your routes. If you dump your production ready files straight into Apache's htdocs directory, it will work out of the box.

I hope this helps...

over 4 years ago · Santiago Trujillo 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