Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

278
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!