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
Is it possible to extract several js files out of one entry point in webpack?

I have set up webpack to generate the public directory from my development enviroment. I have several pages that are being built. Therefore my entry configuration looks like this:

entry: {
    page_one: [one/main.js, one/index.html, ...]
    page_two: [two/main.js, two/index.html, ...]
}

This works perfectly fine. However i also want to extract some js-files that depends on some serverside renderings. Therefore i dont always have to include those. My initial aproach was to simply add the js file to my entryset. Looks like this:

entry: {
    page_one: [one/main.js, one/maybe.js, one/index.html, ...]
    page_two: [two/main.js, one/another.js, two/index.html, ...]
}

The problem is that both js files get packed into one output file. That kinda makes sense to me but is there some way to archieve my goal of exporting them both separately on the same entrypoint?

Folder structure i get:

 - public
   - one
     - index.html
     - main.js
   - two
     - index.html
     - main.js

Folder structure i want:

 - public
   - one
     - index.html
     - main.js
     - maybe.js
   - two
     - index.html
     - main.js
     - another.js

As mentioned maybe.js and another.js are there but packed into main.js but i want them to be extracted separately.

about 4 years ago · Juan Pablo Isaza
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