{"id":21705,"library":"presetter-preset-rollup","title":"presetter-preset-rollup","description":"An opinionated Presetter preset that adds professional Rollup 4 bundling to any base preset. Current stable version is 8.3.0, with monthly releases following the presetter ecosystem. Key differentiators: provides zero-configuration Rollup setup with dual CJS/ESM output, asset processing (images, CSS, JSON, YAML, GraphQL), TypeScript compilation via @rollup/plugin-typescript, bundle visualization via rollup-plugin-visualizer, and automatic path resolution via tsconfig-paths. Requires presetter 8.3.0 and node >=20.0.0. Compared to manual Rollup configuration or tools like tsdx/tsup, it integrates with the broader presetter ecosystem for linting, testing, and formatting via presetter-preset-essentials.","status":"active","version":"8.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/alvis/presetter","tags":["javascript","presetter","preset","typescript"],"install":[{"cmd":"npm install presetter-preset-rollup","lang":"bash","label":"npm"},{"cmd":"yarn add presetter-preset-rollup","lang":"bash","label":"yarn"},{"cmd":"pnpm add presetter-preset-rollup","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core configuration management framework","package":"presetter","optional":false},{"reason":"Base preset providing linting, testing, formatting, and other essential tools","package":"presetter-preset-essentials","optional":false},{"reason":"Bundler engine (peer dependency)","package":"rollup","optional":false},{"reason":"Converts CommonJS modules to ESM for Rollup","package":"@rollup/plugin-commonjs","optional":false},{"reason":"Resolves node_modules dependencies","package":"@rollup/plugin-node-resolve","optional":false},{"reason":"TypeScript compilation in Rollup","package":"@rollup/plugin-typescript","optional":false},{"reason":"Imports JSON files as modules","package":"@rollup/plugin-json","optional":true},{"reason":"Imports YAML files as modules","package":"@rollup/plugin-yaml","optional":true},{"reason":"Imports image files (base64 or file path)","package":"@rollup/plugin-image","optional":true},{"reason":"Imports GraphQL files as modules","package":"@rollup/plugin-graphql","optional":true},{"reason":"CSS imports and processing","package":"rollup-plugin-postcss","optional":true},{"reason":"Resolve TypeScript path aliases in Rollup","package":"rollup-plugin-tsconfig-paths","optional":true},{"reason":"Bundle visualization and analysis","package":"rollup-plugin-visualizer","optional":true}],"imports":[{"note":"preset is a named export, not default. ESM only.","wrong":"import preset from 'presetter'","symbol":"preset","correct":"import { preset } from 'presetter'"},{"note":"The preset is a default export (function or configuration object). CommonJS require works but named destructuring is wrong.","wrong":"const { rollup } = require('presetter-preset-rollup')","symbol":"default","correct":"import rollup from 'presetter-preset-rollup'"},{"note":"Using the preset requires importing the default export and passing it to the extends array, not just side-effect import.","wrong":"import 'presetter-preset-rollup'","symbol":"presetter-preset-rollup (as a module)","correct":"import rollup from 'presetter-preset-rollup'"},{"note":"Types are re-exported from presetter core; no types are directly exported from this preset.","wrong":"import type from 'presetter-preset-rollup'","symbol":"presetterPresetRollup (type)","correct":"import type { PresetConfig } from 'presetter'"}],"quickstart":{"code":"// presetter.config.ts\nimport { preset } from 'presetter';\nimport essentials from 'presetter-preset-essentials';\nimport rollup from 'presetter-preset-rollup';\n\nexport default preset('my-library', {\n  extends: [essentials, rollup],\n  // Optional: override Rollup-specific settings\n  // Variables: {}, // see presetter-preset-rollup documentation\n});\n\n// Then run:\n// npx presetter bootstrap\n// npx presetter build\n// npx presetter watch","lang":"typescript","description":"Bootstrap a new project with Presetter and Rollup preset, defining the config file and typical build commands."},"warnings":[{"fix":"Upgrade Node.js to 20+","message":"Requires Node.js >= 20.0.0. Older versions will fail.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Install all peer deps: npm i -D @rollup/plugin-commonjs @rollup/plugin-graphql @rollup/plugin-image @rollup/plugin-json @rollup/plugin-node-resolve @rollup/plugin-typescript @rollup/plugin-yaml rollup rollup-plugin-postcss rollup-plugin-tsconfig-paths rollup-plugin-visualizer presetter","message":"Peer dependencies must include @rollup/plugin-commonjs@^29, @rollup/plugin-graphql@^2, @rollup/plugin-image@^3, @rollup/plugin-json@^6, @rollup/plugin-node-resolve@^16, @rollup/plugin-typescript@^12, @rollup/plugin-yaml@^4, rollup@^4, rollup-plugin-postcss@^4, rollup-plugin-tsconfig-paths@^1, rollup-plugin-visualizer@^6, presetter@8.3.0. Missing any will cause build failures.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Always extend both essentials and rollup in your presetter.config.ts","message":"The preset requires presetter-preset-essentials as a base; using it standalone will cause errors.","severity":"gotcha","affected_versions":">=8.0.0"},{"fix":"Backup your existing config before running npx presetter bootstrap","message":"If you already have a rollup.config.js, it will be overwritten by presetter bootstrap. Back it up first.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace CJS-only plugins with ESM-compatible alternatives","message":"Use of CJS-only plugins (like rollup-plugin-analyzer) may conflict with ESM output. The preset strongly prefers ESM-first plugins.","severity":"deprecated","affected_versions":">=8.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm i -D @rollup/plugin-commonjs","cause":"Missing peer dependency; not automatically installed with npm install presetter-preset-rollup","error":"Error: Cannot find module '@rollup/plugin-commonjs'"},{"fix":"npm i -D presetter-preset-essentials and include it in extends array","cause":"Attempting to use rollup preset without the essentials base preset","error":"Error: presetter-preset-essentials is required but not found"},{"fix":"Upgrade Node.js to version 20 or later","cause":"Node.js 18 is end-of-life and the preset enforces 20+","error":"Error: Node.js version 18.x.x is not supported. Please upgrade to >=20.0.0"},{"fix":"Use import rollup from 'presetter-preset-rollup' (default import), not named import","cause":"Default import treated as an object instead of a function; importing incorrectly","error":"TypeError: presetterPresetRollup is not a function"},{"fix":"Ensure @rollup/plugin-image is installed and included in peer deps","cause":"Missing @rollup/plugin-image or misconfigured asset handling","error":"RollupError: Could not resolve 'image.svg' from 'src/index.ts'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}