A Cypress preprocessor that uses Vite to bundle JavaScript test files. The current version is 1.0.1, released with a low cadence (no major changes yet). It requires Cypress ^10.3.1, Rollup ^2.77.0, and Vite ^3.0.2. Unlike alternatives (e.g., cypress-webpack-preprocessor, cypress-esbuild-preprocessor), this leverages Vite's fast bundling and native ESM support, but has limited configuration and is tied to specific peer dependency versions. It outputs CommonJS for Cypress compatibility.
npm install cypress-vite-preprocessorVerified import paths — ran on the pinned version, not inferred.
Configures Cypress to use Vite as the file preprocessor for bundling test files.
Migrate to @cypress/vite-dev-server and cypress-vite if using Cypress 10+.
Pin Vite to 3.x and Rollup to 2.x, or use a different preprocessor.
Use require() instead of import in Cypress configuration.
Upgrade Node.js to 18 or newer.
Run: npm install cypress-vite-preprocessor --save-dev
Provide a custom Vite config with the appropriate plugin.
Use 'const { createVitePreprocessor } = require('cypress-vite-preprocessor')'.