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

150
Vistas
Use RollupJS to combine legacy JS in web page

I'm cleaning up a set of old web pages that load a lot of legacy JS one by one:

<html>
  <head>
  <script src="/js/module1.js" />
  <script src="/js/module2.js" />
  <script src="/js/module3.js" />
...
  <script src="/js/module20.js" />

They are all rather small files, so a single call to a combined JS bundle would be faster, especially with cache on (ask once for a "not modified" instead of 20 times).

So I thought using rollupJS but I struggle to understand how to achieve my goal. I tried

rollup js/*.js --file bundle.js

to get the error:

[!] Error: Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.

Then I tried:

rollup js/*.js --dir temp

It resulted in a directory of individual processed files.

so next attempt:

rollup js/*.js --file bundle.js --inlineDynamicImports

Error: Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true

What do I miss - or do I need a different tool?

Goal: take all the JS in the directory and combine and minify it into on JS file

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