Files
cypress/npm/webpack-preprocessor/AGENTS.md
T
Ryan Manuel 4931cf06ff chore: bootstrap AI agent context files (AGENTS.md + CLAUDE.md) (#33429)
* chore: bootstrap AI agent context files (AGENTS.md + CLAUDE.md)

Adds a three-tier set of AI context files across the monorepo:

- Root AGENTS.md / CLAUDE.md — project overview, workspaces, common
  commands, architecture map, code conventions, and CI/CD summary
- Workspace-level pairs for cli/, packages/, npm/, tooling/,
  system-tests/, and scripts/
- Package-level pairs for all 33 packages/, 15 npm/, 3 tooling/
  packages, and the cli workspace (117 files total)

CLAUDE.md files are thin wrappers (@AGENTS.md import + workflow rules)
so Claude Code picks them up walking upward from cwd. AGENTS.md files
carry the substantive content and are also read natively by Codex CLI
and Cursor.

Command conventions applied throughout:
- No watch / file-watcher commands (agents run once and read results)
- No bare full-suite test runs for large packages; always target a
  specific file (<path-to-spec>) or glob ("<glob-pattern>")
- No cypress:open (interactive mode); use cypress:run with --spec
- Test runner syntax varies by package: vitest (test --),
  mocha (test-unit/test-integration --), jest (--testPathPattern),
  Cypress CT (cypress:run:ct -- --spec)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* gitignore

* clarify AI internal docs and contribution guidelines

* update TOC

* tweak nvm wording

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 16:01:52 -05:00

1.4 KiB

@cypress/webpack-preprocessor

@cypress/webpack-preprocessor is a published npm package that provides a Cypress file preprocessor for bundling test files via Webpack 5. It is a low-level package that does not include any loaders or Babel plugins — consumers must configure webpack themselves.

Key Commands

yarn build        # rimraf dist + tsc; outputs to dist/
yarn check-ts     # TypeScript type-check without emitting
yarn lint         # ESLint
yarn test-unit -- <path-to-spec>            # run a specific vitest unit spec file
yarn test-unit -- "<glob-pattern>"          # run unit specs matching a glob
yarn test-e2e -- <path-to-spec>             # run a specific vitest e2e spec file

Architecture

  • lib/index.ts (compiled to dist/) — main entry; exports the preprocessor factory function
  • test/unit/ — vitest unit tests
  • test/e2e/ — vitest e2e tests that exercise real webpack compilation
  • scripts/test-webpack-5.ts — test runner script invoked by yarn test

Gotchas / Notes

  • Peer dependencies (@babel/core, @babel/preset-env, babel-loader, webpack@^5) must be installed in the consumer's project. This package deliberately ships without bundled loaders.
  • For a batteries-included alternative with TypeScript and CoffeeScript support built-in, use @cypress/webpack-batteries-included-preprocessor.
  • The main field points to dist (a directory), relying on Node's index.js resolution within it.