An opinionated, production-ready Rollup preset collection for building TypeScript libraries and applications. Current version 0.0.27 (early stage, frequent releases). Provides automatic multi-format (ESM/CJS) builds, TypeScript declaration generation, path alias resolution from tsconfig.json, and a four-stage plugin system (pre, transform, post) for extensibility. Differentiators: minimal configuration via package.json exports, built-in esbuild for speed, and opinionated defaults that reduce boilerplate versus raw Rollup setup.
npm install rollup-presetsVerified import paths — ran on the pinned version, not inferred.
Minimal Rollup config using libraryPreset to build a TypeScript library with ESM and CJS formats.
Add an 'exports' field or standard fields to your package.json defining the entry points (import, require, types, source).
Pin to a specific version and test upgrades carefully. Consider using lockfiles.
Use dynamic import: const { libraryPreset } = await import('rollup-presets'); or set your project to ESM (type: 'module' in package.json).Set preserveModules: false to flatten output, or ensure your consuming app handles nested imports.
Run: npm install rollup-presets --save-dev. Then verify import path: 'rollup-presets' (not 'rollup/presets').
Ensure your package.json includes an 'exports' field like: {"exports": {".": {"import": "./dist/esm/index.js", "require": "./dist/cjs/index.js", "types": "./dist/types/index.d.ts", "source": "./src/index.ts"}}}Change your rollup.config.js to .mjs extension or use dynamic import: const { libraryPreset } = await import('rollup-presets');No dependency data recorded yet.