{"id":21092,"library":"cypress-esbuild-preprocessor","title":"cypress-esbuild-preprocessor","description":"A Cypress preprocessor that uses esbuild to bundle test specs, offering roughly 50x faster performance compared to Webpack/Babel/TypeScript-based alternatives. Current stable version is 1.0.2, with a low release cadence focused on bug fixes and compatibility. Key differentiators: zero-config TypeScript support via tsconfig, path alias resolution, and minimal overhead. Requires esbuild as a peer dependency. Suited for teams looking to speed up Cypress test execution in CI or local development.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/sod/cypress-esbuild-preprocessor","tags":["javascript","cypress","preprocessor","esbuild","typescript"],"install":[{"cmd":"npm install cypress-esbuild-preprocessor","lang":"bash","label":"npm"},{"cmd":"yarn add cypress-esbuild-preprocessor","lang":"bash","label":"yarn"},{"cmd":"pnpm add cypress-esbuild-preprocessor","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for bundling specs","package":"esbuild","optional":false}],"imports":[{"note":"CommonJS require works without .default; ESM named export is preferred.","wrong":"const cypressEsbuildPreprocessor = require('cypress-esbuild-preprocessor').default","symbol":"cypressEsbuildPreprocessor","correct":"import { cypressEsbuildPreprocessor } from 'cypress-esbuild-preprocessor'"},{"note":"The module exports a named function, not a default. Do not call it as a default import.","wrong":"const cypressEsbuildPreprocessor = require('cypress-esbuild-preprocessor')","symbol":"cypressEsbuildPreprocessor","correct":"const { cypressEsbuildPreprocessor } = require('cypress-esbuild-preprocessor')"},{"note":"The tsconfig path must be nested under the 'esbuildOptions' key, not at the top level.","wrong":"cypressEsbuildPreprocessor({ tsconfig: './tsconfig.json' })","symbol":"options","correct":"cypressEsbuildPreprocessor({ esbuildOptions: { tsconfig: './tsconfig.json' } })"}],"quickstart":{"code":"// cypress/plugins/index.ts\nimport { cypressEsbuildPreprocessor } from 'cypress-esbuild-preprocessor';\nimport path from 'path';\n\nmodule.exports = (on, config) => {\n  on(\n    'file:preprocessor',\n    cypressEsbuildPreprocessor({\n      esbuildOptions: {\n        tsconfig: path.resolve(__dirname, '../tsconfig.json'),\n      },\n    })\n  );\n};\n","lang":"typescript","description":"Shows how to configure the preprocessor in Cypress plugins file with TypeScript and tsconfig path resolution."},"warnings":[{"fix":"Use named import: import { cypressEsbuildPreprocessor } from 'cypress-esbuild-preprocessor'","message":"The module exports a named function, not a default. Using default import will result in undefined or runtime error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pass options as { esbuildOptions: { tsconfig: './tsconfig.json' } }","message":"The esbuildOptions object must contain tsconfig path at the correct nested level. Placing tsconfig directly in the top-level options will be ignored.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Move configuration to cypress/plugins/index file.","message":"The plugin file should be placed in cypress/plugins/index.js or .ts, not in support or integration folders.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run npm install -D esbuild cypress-esbuild-preprocessor","cause":"Missing dependency or incorrect import path.","error":"Error: Cannot find module 'cypress-esbuild-preprocessor'"},{"fix":"Change to import { cypressEsbuildPreprocessor } from 'cypress-esbuild-preprocessor'","cause":"Default import instead of named import.","error":"TypeError: cypressEsbuildPreprocessor is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}