{"id":22323,"library":"rollup-worker","title":"Rollup Worker","description":"A CLI tool that wraps Rollup with built-in plugins for simplified, zero-config bundle management across multiple entry points. Version 2.0.1, with a next tag for latest releases. Key differentiators: plugin aliases (e.g., 'resolve', 'typescript', 'babel') that auto-configure, per-entry plugin overrides via functions, and a default config file (.fssrc.js). Targets Node >=7.10.1, and supports common formats (ESM, CJS, UMD, IIFE). Less flexible than raw Rollup but reduces boilerplate for multi-bundle workflows.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","rollup","rollup-worker","rb","bundle","zero-config"],"install":[{"cmd":"npm install rollup-worker","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-worker","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-worker","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core bundler, though not listed as peer dependency; rollup-worker relies on it internally.","package":"rollup","optional":false}],"imports":[{"note":"rollup-worker is a CLI tool, not a library. Importing as a Node module will not work as expected.","wrong":"require('rollup-worker')","symbol":"cli usage","correct":"npx rollup-worker -c .fssrc.js"},{"note":"Config file .fssrc.js must use CommonJS to export config object, even if your project is ESM.","wrong":"export default { ... }","symbol":"config export","correct":"module.exports = { ... }"},{"note":"Plugin names are specific: 'resolve' (not 'nodeResolve'), 'typescript' (not 'ts'), 'commonjs', 'babel', 'globals', 'node-builtins'.","wrong":"const plugins = ['nodeResolve', 'ts'];","symbol":"plugin list","correct":"const plugins = ['resolve', 'typescript'];"}],"quickstart":{"code":"// .fssrc.js\nconst { version, name, author, dependencies } = require('./package.json')\nconst banner = `/*! ${name} v${version} | MIT licensed. | by ${author} */`\n\nmodule.exports = {\n  plugins: {\n    resolve: () => ({ preferBuiltins: false }),\n    commonjs: {},\n    babel: (cfg) => ({ comments: cfg.output.format !== 'iife' }),\n    replace: { __VERSION__: version }\n  },\n  entry: [\n    {\n      input: './src/main.js',\n      plugins: ['resolve', 'commonjs', 'babel'],\n      output: [\n        { format: 'es', file: 'dist/bundle.esm.js' },\n        { format: 'cjs', file: 'dist/bundle.cjs.js', banner }\n      ]\n    }\n  ]\n}","lang":"javascript","description":"Minimal config file showing plugin aliases, per-entry overrides, and multiple output formats."},"warnings":[{"fix":"Install with 'npm i -g rollup-worker@latest' or just 'npm i -g rollup-worker'.","message":"The 'next' install tag (npm i -g rollup-worker@next) is deprecated; use latest instead.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Check internal plugin mapping for each alias; override plugin config via function to control options.","message":"Plugin alises may conflict with older Rollup plugin names; e.g., 'resolve' maps to @rollup/plugin-node-resolve but behavior differs.","severity":"gotcha","affected_versions":"all"},{"fix":"Use CommonJS export: module.exports = { ... }.","message":"Config file .fssrc.js must export via module.exports, not export default; failing silently yields no output.","severity":"gotcha","affected_versions":"all"},{"fix":"Inspect plugin source or log the argument: plugins: { myPlugin: (cfg) => { console.log(cfg); return {}; } }.","message":"Plugin configuration functions receive { output, ... } , but some plugins expect different signature (e.g., typescript receives rollupCfg).","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install the missing plugin: npm install --save-dev @rollup/plugin-node-resolve","cause":"rollup-worker does not bundle all Rollup plugins; they must be installed separately if not included by default.","error":"Error: Cannot find module '@rollup/plugin-node-resolve'"},{"fix":"Convert to CommonJS: replace 'export default' with 'module.exports ='.","cause":"Config file uses ESM syntax (e.g., import/export) but rollup-worker expects CJS.","error":"Unexpected token: punc (.)"},{"fix":"Add 'node-builtins' to the plugins array.","cause":"Rollup by default externalizes Node built-ins, but 'node-builtins' plugin must be enabled to shim them.","error":"Error: Could not resolve 'fs' (or other Node built-in)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}