{"id":22534,"library":"videojs-generate-rollup-config","title":"videojs-generate-rollup-config","description":"Generates a standard Rollup configuration for Video.js plugins, reducing boilerplate across repositories. Current version 7.0.2 requires Rollup ^2.26.11 and provides preconfigured builds for CJS, ES, test, browser, and minified browser outputs. It supports customization via options like input, globals, externals, and plugins, and uses environment variables like TEST_BUNDLE_ONLY. Compared to writing manual Rollup configs, it enforces Video.js conventions and simplifies maintenance.","status":"active","version":"7.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/videojs/videojs-generate-rollup-config","tags":["javascript"],"install":[{"cmd":"npm install videojs-generate-rollup-config","lang":"bash","label":"npm"},{"cmd":"yarn add videojs-generate-rollup-config","lang":"bash","label":"yarn"},{"cmd":"pnpm add videojs-generate-rollup-config","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to run Rollup builds","package":"rollup","optional":false}],"imports":[{"note":"CommonJS only; ESM import is not supported by this package (no 'type': 'module' or .mjs).","wrong":"import generateRollupConfig from 'videojs-generate-rollup-config';","symbol":"generateRollupConfig","correct":"const generateRollupConfig = require('videojs-generate-rollup-config');"},{"note":"config.builds is an object with keys like 'cjs', 'es', 'test', 'browser', 'minBrowser'. Must convert to array for Rollup.","wrong":"const builds = config.builds; // then spread or map incorrectly","symbol":"config.builds","correct":"const config = generateRollupConfig(); const builds = Object.values(config.builds);"},{"note":"defaultExternals is a static property on the function, not on the returned config object.","wrong":"const defaultExternals = generateRollupConfig().defaultExternals;","symbol":"defaultExternals","correct":"const { defaultExternals } = generateRollupConfig;"}],"quickstart":{"code":"const generate = require('videojs-generate-rollup-config');\nconst config = generate({\n  input: 'src/plugin.js',\n  distName: 'my-plugin',\n  exportName: 'MyPlugin'\n});\nmodule.exports = Object.values(config.builds);","lang":"javascript","description":"Creates a Rollup config with standard Video.js plugin builds using CommonJS require."},"warnings":[{"fix":"Update peer dependency to rollup@^2.26.11 for v7.","message":"Version 3+ supports Rollup ^1.0.0; version 7 requires Rollup ^2.26.11. Upgrade Rollup accordingly.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Use const x = require('videojs-generate-rollup-config') instead of import.","message":"The package uses CommonJS and cannot be imported via ESM (import). Use require().","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Object.values(config.builds) when exporting.","message":"config.builds is an object, not an array. Must use Object.values() for Rollup's array input.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ignore badge; service is no longer active.","message":"The environment variable greenkeeper badge in README references deprecated Greenkeeper service.","severity":"deprecated","affected_versions":"all"},{"fix":"Use only one environment variable to avoid confusion.","message":"Setting both TEST_BUNDLE_ONLY and NO_TEST_BUNDLE: TEST_BUNDLE_ONLY takes precedence.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install --save-dev rollup@^2.26.11","cause":"Rollup not installed as a devDependency.","error":"Error: Cannot find module 'rollup'"},{"fix":"Use const generateRollupConfig = require('videojs-generate-rollup-config');","cause":"Attempting to import as ES module (import) instead of require.","error":"Uncaught TypeError: generateRollupConfig is not a function"},{"fix":"Wrap with Object.values(config.builds) before exporting.","cause":"config.builds is an object, not an array.","error":"TypeError: config.builds is not iterable"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}