Skip to content

Conversation

@lucgonp
Copy link

@lucgonp lucgonp commented Nov 26, 2025

…ormance

  • Replace fs.readFileSync with async fs.readFile
  • Add proper error handling with debug logs
  • Improve performance by avoiding event loop blocking
  • Remove TODO comment about async fs methods

This follows Node.js best practices and improves DX with faster build times.

  • Closes

Additional details

Steps to test

How has the user experience changed?

PR Tasks


Note

Switches to async file reads, adds cached init loader with error-handled loading, and injects it into transformed index.html.

  • Vite dev server plugin (npm/vite-dev-server/src/plugins/cypress.ts):
    • Replace sync fs.readFileSync and fs.promises.readFile with fs/promises.readFile imports/usage.
    • Add async loadInitFile with debug logging and error handling; introduce cached loaderPromise via getLoaderPromise.
    • transformIndexHtml: read index.html asynchronously and inject loader content via await getLoaderPromise().
    • Remove obsolete TODO about async fs methods.

Written by Cursor Bugbot for commit 16c42f3. This will update automatically on new commits. Configure here.

…ormance

- Replace fs.readFileSync with async fs.readFile
- Add proper error handling with debug logs
- Improve performance by avoiding event loop blocking
- Remove TODO comment about async fs methods

This follows Node.js best practices and improves DX with faster build times.
@cypress-app-bot
Copy link
Collaborator

@lucgonp lucgonp marked this pull request as draft November 28, 2025 16:54
@lucgonp lucgonp marked this pull request as ready for review November 28, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants