{"id":25154,"library":"cypress-rollup-preprocessor","title":"Cypress Rollup Preprocessor","description":"A Cypress preprocessor that bundles JavaScript test files using Rollup. Version 1.2.0, released 2022-06-18, is the latest stable release. The package is maintained with semantic versioning; breaking changes are documented in changelogs. It supports Cypress >=10 (ESM config) and <=9 (CJS config). Unlike alternatives like cy-rollup, this package closely follows the official Cypress preprocessor API and supports full Rollup input/output options, TypeScript configs, and watch mode. It requires Rollup 2.x as a peer dependency and ships TypeScript type definitions.","status":"active","version":"1.2.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/lmarqs/cypress-rollup-preprocessor","tags":["javascript","cypress","cypress-plugin","cypress-preprocessor","cypress-rollup-preprocessor","rollup","typescript"],"install":[{"cmd":"npm install cypress-rollup-preprocessor","lang":"bash","label":"npm"},{"cmd":"yarn add cypress-rollup-preprocessor","lang":"bash","label":"yarn"},{"cmd":"pnpm add cypress-rollup-preprocessor","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for bundling JavaScript files","package":"rollup","optional":true}],"imports":[{"note":"Default export; CJS users must use require('cypress-rollup-preprocessor') without .default, but TypeScript users may need .default if esModuleInterop is off.","wrong":"const rollupPreprocessor = require('cypress-rollup-preprocessor').default","symbol":"default (rollupPreprocessor)","correct":"import rollupPreprocessor from 'cypress-rollup-preprocessor'"},{"note":"The package exports a single function as default. Destructuring will fail.","wrong":"const { rollupPreprocessor } = require('cypress-rollup-preprocessor')","symbol":"default (CJS require)","correct":"const rollupPreprocessor = require('cypress-rollup-preprocessor')"},{"note":"Types are exported as named exports. Use `import type` for tree-shaking in TypeScript.","wrong":"import { CypressRollupPreprocessorOptions } from 'cypress-rollup-preprocessor'","symbol":"TypeScript type imports","correct":"import type { CypressRollupPreprocessorOptions } from 'cypress-rollup-preprocessor'"}],"quickstart":{"code":"// cypress.config.ts (Cypress >=10)\nimport { defineConfig } from 'cypress'\nimport rollupPreprocessor from 'cypress-rollup-preprocessor'\n\nexport default defineConfig({\n  e2e: {\n    setupNodeEvents(on, config) {\n      on('file:preprocessor', rollupPreprocessor())\n    },\n  },\n})\n\n// For custom Rollup options:\nimport rollupConfig from './rollup.config'\nconst { output: outputOptions, ...inputOptions } = rollupConfig\non('file:preprocessor', rollupPreprocessor({ inputOptions, outputOptions }))","lang":"typescript","description":"Shows how to use the preprocessor with Cypress >=10, including default usage and custom Rollup options."},"warnings":[{"fix":"Replace `rollupOptions` with `inputOptions` and `outputOptions` separately. Example: rollupPreprocessor({ inputOptions, outputOptions })","message":"In v0.7.0, the option 'rollupOptions' was renamed to 'inputOptions' and 'outputOptions'. Using 'rollupOptions' will cause a runtime error.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Migrate to Cypress >=10 and use ESM syntax: import rollupPreprocessor from 'cypress-rollup-preprocessor'","message":"Cypress <=9 support is deprecated; newer versions may drop CJS require pattern.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use `import rollupPreprocessor from 'cypress-rollup-preprocessor'` with esModuleInterop, or use `const rollupPreprocessor = require('cypress-rollup-preprocessor')` in CJS.","message":"If you use TypeScript without 'esModuleInterop', default import may fail. Users incorrectly destructure the export.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Install rollup@2.x as a peer dependency: npm install rollup@^2.0.0 --save-dev","message":"The preprocessor only supports Rollup 2.x. Using Rollup 3.x or 4.x will cause incompatibility errors.","severity":"gotcha","affected_versions":""}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install cypress-rollup-preprocessor rollup@^2.0.0 --save-dev`","cause":"Package not installed or missing peer dependencies.","error":"Cannot find module 'cypress-rollup-preprocessor'"},{"fix":"Use `rollupPreprocessor({ inputOptions, outputOptions })` instead of `rollupPreprocessor({ rollupOptions })`","cause":"Option name changed in v0.7.0 from 'rollupOptions' to 'inputOptions'/'outputOptions'.","error":"Error: rollupOptions is not a function"},{"fix":"Use `import rollupPreprocessor from 'cypress-rollup-preprocessor'` (ESM) or `const rollupPreprocessor = require('cypress-rollup-preprocessor')` (CJS).","cause":"Incorrect import or destructuring; default export not used correctly.","error":"TypeError: rollupPreprocessor is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}