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

134
Vistas
Using node.js experimental loaders with rollup

I am using rollup to bundle my Node.js applications - it allows me to deploy them in production as a single file without relying on npm.

I also happen to have my own custom loaders for some special format files that I import in my code by calling

node --experimental-loader=./lib/txt-colormap-es-loader.mjs and then doing

import colormap from './colormaps/01.txt';

One of these is handlebars for which there is a special plugin in rollup.

But I also have my own custom formats with my own custom loaders.

Does anyone see any way I could make rollup work with my custom ES6 loader in Node.js short of writing a new plugin?

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

0

I found a suboptimal solution without developing/publishing/maintaining a new rollup plugin - import the loader itself and call it manually on the file imported as a string. Importing as a string can be accomplished

  • In development, before bundling, by

    https://www.npmjs.com/package/import-as-string

  • In production, with rollup, by

    https://www.npmjs.com/package/rollup-plugin-string

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