{"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,"search_vec":"'-06':18 '-18':19 '1.2.0':15 '10':41 '2':77 '2022':17 '9':45 'altern':49 'api':62 'break':32 'bundl':8 'chang':33 'changelog':37 'cjs':46 'close':56 'config':43,47,70 'cy':52 'cy-rollup':51 'cypress':1,5,40,60,89,91,94,97 'cypress-plugin':90 'cypress-preprocessor':93 'cypress-rollup-preprocessor':96 'definit':87 'depend':82 'document':35 'esm':42 'file':11 'follow':57 'full':65 'input/output':67 'javascript':9,88 'latest':22 'like':50 'maintain':28 'mode':73 'offici':59 'option':68 'packag':26,55 'peer':81 'plugin':92 'preprocessor':3,6,61,95,99 'releas':16,24 'requir':75 'rollup':2,13,53,66,76,98,100 'semant':30 'ship':84 'stabl':23 'support':39,64 'test':10 'type':86 'typescript':69,85,101 'unlik':48 'use':12 'version':14,31 'watch':72 'x':78","created_at":"2026-05-01T13:43:17.881951+00:00","updated_at":"2026-05-01T13:43:17.881951+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://lmarqs.github.io/cypress-rollup-preprocessor","github":"https://github.com/lmarqs/cypress-rollup-preprocessor","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/cypress-rollup-preprocessor","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}