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

270
Vistas
Modularize 'rollup.config' | "Error: Could not resolve 'path/to/module' from rollup.config.js"

I'm in the process of implementing rollup into my mono repo library for better bundling.

Issue

Since the library is a mono repo, I want to reuse build configurations for the individual packages. I've tried to do so by outsourcing methods that return specific build configurations(e.g. createCommonJsConfig(), createESMConfig()) into a file called rollup.default.config.ts which is located at the root of the mono repo.

These functions are then imported into the rollup.config.js file of each package to create the final rollup configuration.

// rollup.config.js of an individual package

import {
  createCommonJSConfig,
  createDeclarationConfig,
  createESMConfig,
} from '../rollup.config.default';

// https://rollupjs.org/guide/en/#configuration-files
export default function () {
  return [
    createDeclarationConfig(),
    createCommonJSConfig(),
    createESMConfig({ multiFileOutput: true }),
  ];
}

Unfortunately, as soon as I import the rollup.config.default.ts file into a rollup.config.js file of a package, I get this error:

[!] Error: Could not resolve '../rollup.config.default' from rollup.config.js

Question

Does anybody know whether it is possible to somehow modularize a rollup.config.js file to reuse commonly used parts.

  • repo: https://github.com/agile-ts/agile
  • rollup.default.config.ts: https://github.com/agile-ts/agile/blob/removing-internal/packages/rollup.config.default.ts

Thanks a lot ;D

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

0

Resolved this issue by being consistent with my config file extension -> After I've transformed the rollup.default.config.ts file to a rollup.default.config.js file it worked as expected.

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