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

189
Vistas
Can webpack automatically change href links in an HTML page?

I'm new to using webpack and right now I've just got a basic setup with an index.html page that has a reference to a test page like so: <a href="/test.html">license</a>

Right now, webpack is loading the index.html page into a dist folder using the HTMLWebpackPlugin, and my test.html file is staying in my src folder. What I want to achieve is for the test.html file to also be loaded into the dist folder, but for the href within the index.html file to automatically be updated. This is because when I'm using the HTMLWebpackPlugin, I am renaming the HTML files that go to the dist folder with names such as dist-index.html and dist-test.HTML for clarity. Is this possible?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you want to use multiple HTML pages with webpack you should use this code example:

plugins: [
  new HtmlWebpackPlugin({
    filename: 'index.html',
    template: 'src/index.html',
    chunks: ['main']
  }),
  new HtmlWebpackPlugin({
    filename: 'example.html',
    template: 'src/example.html',
    chunks: ['exampleEntry']
  })
]

Instead if you are using some libraries like React, you should install react-router-dom and use the default configuration.

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