Skip to content

feat: Replace webpack with vite as the default e2e file preprocessor #31751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AtofStryker opened this issue May 20, 2025 · 0 comments
Open
Labels
npm: @cypress/webpack-preprocessor @cypress/webpack-preprocessor package issues npm: webpack-batteries-included-preprocessor @cypress/webpack-batteries-included-preprocessor package issues topic: preprocessors 🔧

Comments

@AtofStryker
Copy link
Contributor

AtofStryker commented May 20, 2025

Overview

We should consider replacing webpack with Vite as the default preprocessor in Cypress. Vite offers several advantages that could improve the developer experience and test execution performance. This is also documented in the 3rd party preprocessor, cypress-vite

Current Behavior

Currently, Cypress uses webpack as the default preprocessor for handling test files and dependencies. While webpack is powerful and well-established, it has some limitations:

  • Slower build times compared to Vite
  • More complex configuration required
  • Heavier development bundle sizes

Desired Behavior

Replace webpack with Vite as the default preprocessor to:

  1. Improve test execution startup time through Vite's native ESM-based dev server
  2. Reduce configuration complexity for most common use cases
  3. Leverage Vite's faster hot module replacement (HMR)
  4. Take advantage of Vite's built-in support for TypeScript, JSX, and other modern features
  5. Provide better out-of-the-box performance for component testing

Benefits

  • Faster Development Experience: Vite's dev server starts instantly and updates are reflected immediately
  • Simpler Configuration: Most projects would require minimal or no additional configuration
  • Modern Defaults: Better support for ES modules and modern JavaScript features
  • Reduced Bundle Size: Vite's approach to bundling could lead to smaller development bundles
  • Improved DX: Less configuration overhead for developers

Considerations

  • Maintain webpack as an option for projects that require it, likely though the preprocessor npm packages that exist today
  • Provide migration path for existing projects
  • Ensure compatibility with existing Cypress features and plugins
  • Consider impact on CI/CD pipelines and build times

Questions to Address

  1. What would the migration path look like for existing projects?
    • migration should be seamless as work OOTB the say way as the batteries included webpack preprocessor
  2. What impact would this have on existing plugins and integrations?
@AtofStryker AtofStryker changed the title feat: Replace webpack with Vite as default preprocessor feat: Replace webpack with vite as the default e2e file preprocessor May 20, 2025
@AtofStryker AtofStryker added npm: @cypress/webpack-preprocessor @cypress/webpack-preprocessor package issues npm: webpack-batteries-included-preprocessor @cypress/webpack-batteries-included-preprocessor package issues topic: preprocessors 🔧 labels May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm: @cypress/webpack-preprocessor @cypress/webpack-preprocessor package issues npm: webpack-batteries-included-preprocessor @cypress/webpack-batteries-included-preprocessor package issues topic: preprocessors 🔧
Projects
None yet
Development

No branches or pull requests

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy