rollup-simple-configer

raw JSON →
0.1.3 verified Mon Apr 27 auth: no javascript

A utility to quickly generate Rollup configurations for TypeScript projects. Version 0.1.3, stable but infrequent releases. Simplifies setup with minimal boilerplate, handling TypeScript compilation, CommonJS/ESM output, and external dependencies. Different from manual configs by offering a declarative API with sensible defaults, reducing the learning curve for bundling TypeScript with Rollup. Currently without active maintenance updates.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/rollup-simple-configer/index.mjs not supported.
cause Package is ESM-only, but importing via require() in CommonJS project.
fix
Use dynamic import() or refactor project to use ESM.
error TypeError: Plugin is not a function
cause Passing a plugin constructor instead of an instance in plugins array.
fix
Ensure plugins are instantiated (e.g., typescript() instead of typescript).
breaking Package is ESM-only; importing via require() or using CJS projects will fail.
fix Use dynamic import() or switch project to ESM.
deprecated All options are considered stable, but no active development is expected. Consider manual Rollup config for complex needs.
fix Evaluate if custom config is needed.
gotcha The `plugins` option must include an array of Rollup plugins; it does not preset TypeScript plugin automatically.
fix Always pass the desired plugins in the options.
gotcha The package does not handle TypeScript config resolution; tsconfig must be handled separately via plugin options.
fix Configure TypeScript plugin explicitly with tsconfig path.
npm install rollup-simple-configer
yarn add rollup-simple-configer
pnpm add rollup-simple-configer

Creates a Rollup configuration for a TypeScript project with CJS and ESM outputs, using @rollup/plugin-typescript.

import { createConfig } from 'rollup-simple-configer';
import typescript from '@rollup/plugin-typescript';

const config = createConfig({
  input: 'src/index.ts',
  output: [
    { file: 'dist/bundle.cjs.js', format: 'cjs' },
    { file: 'dist/bundle.esm.js', format: 'esm' }
  ],
  plugins: [typescript()],
  external: ['lodash']
});

export default config;