{"id":21892,"library":"rollup-config-pectin","title":"rollup-config-pectin","description":"A Rollup configuration preset for building tree-shakeable JavaScript libraries using conventional file patterns. Version 4.0.4 requires Node >=8.9 and Rollup >=1.12.0. It simplifies setting up Rollup with Babel and ensures proper main/module exports for ESM and CJS. Differentiators: convention over configuration, zero-config unless custom Babel preset options needed, and explicit support for tree-shaking via peer dependencies. Aimed at library authors who want a minimal Rollup setup without manual config.","status":"active","version":"4.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/evocateur/pectin","tags":["javascript","rollup","config","tree-shake","module"],"install":[{"cmd":"npm install rollup-config-pectin","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-config-pectin","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-config-pectin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; the plugin provides Rollup configuration that requires Rollup to be installed.","package":"rollup","optional":true}],"imports":[{"note":"The package exports a single default configuration object. ESM import is recommended; CommonJS require may still work but is not the primary export.","wrong":"const pectin = require('rollup-config-pectin'); module.exports = pectin;","symbol":"pectin","correct":"import pectin from 'rollup-config-pectin'; export default pectin;"}],"quickstart":{"code":"// package.json\n{\n  \"main\": \"dist/index.cjs.js\",\n  \"module\": \"dist/index.esm.js\"\n}\n\n// .babelrc (must accept options)\n{\n  \"presets\": [\n    [\"@babel/preset-env\", { \"modules\": false }]\n  ]\n}\n\n// rollup.config.js (if using programmatic API)\nimport pectin from 'rollup-config-pectin';\nexport default pectin({\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: ['cjs', 'es']\n  }\n});\n\n// Or via CLI:\n// rollup -c node:pectin -i src/index.js","lang":"javascript","description":"Shows setup: package.json with main/module, Babel config with modules:false, and using rollup-config-pectin via CLI or programmatic API."},"warnings":[{"fix":"Add 'main' and 'module' fields to package.json pointing to your output files.","message":"The package expects both 'main' and 'module' fields in package.json, otherwise output may be incomplete.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure your Babel preset configuration is set appropriately (e.g., {modules: false}).","message":"If you have a .babelrc, the preset used must accept options (e.g., @babel/preset-env with modules:false), otherwise Rollup's tree-shaking may fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using the programmatic API (import default) for future-proofing.","message":"The package uses the older node:pectin preset for Rollup CLI which may become deprecated in future Rollup versions.","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"search_vec":"'1.12.0':27 '4.0.4':21 '8.9':24 'aim':67 'author':70 'babel':34,53 'build':10 'cjs':43 'config':3,50,79,82 'configur':7,47 'convent':17,45 'custom':52 'depend':66 'differenti':44 'ensur':36 'esm':41 'explicit':58 'export':39 'file':18 'javascript':14,80 'librari':15,69 'main/module':38 'manual':78 'minim':74 'modul':86 'need':56 'node':23 'option':55 'pattern':19 'pectin':4 'peer':65 'preset':8,54 'proper':37 'requir':22 'rollup':2,6,26,32,75,81 'rollup-config-pectin':1 'set':30 'setup':76 'shake':63,85 'shakeabl':13 'simplifi':29 'support':59 'tree':12,62,84 'tree-shak':11,61,83 'unless':51 'use':16 'version':20 'via':64 'want':72 'without':77 'zero':49 'zero-config':48","created_at":"2026-04-27T17:02:18.468182+00:00","updated_at":"2026-04-27T17:02:18.468182+00:00","problems":[{"fix":"Ensure 'src/index.js' exists or specify correct input path via -i flag or options.","cause":"Missing or incorrect 'input' option or no 'src/index.js' file.","error":"Error: Could not resolve entry module"},{"fix":"Rename file to 'src/index.js' or configure rollup-config-pectin with an appropriate plugin for TypeScript.","cause":"The configuration expects a JavaScript file (src/index.js) but only TypeScript files exist.","error":"(!) Plugin typescript: @rollup/plugin-typescript: Could not find source file: 'src/index.ts'"},{"fix":"Add both 'main' and 'module' fields to package.json.","cause":"The preset checks for these fields and throws if missing.","error":"Error: You must specify 'main' and 'module' in package.json"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"rollup","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/evocateur/pectin","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-config-pectin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}