Skip to content

test: update examples to type: module (ESM)#1672

Merged
jennifer-shehane merged 1 commit intocypress-io:masterfrom
MikeMcC399:examples-esm-upgrade
Mar 3, 2026
Merged

test: update examples to type: module (ESM)#1672
jennifer-shehane merged 1 commit intocypress-io:masterfrom
MikeMcC399:examples-esm-upgrade

Conversation

@MikeMcC399
Copy link
Collaborator

Situation

  • Cypress projects in the examples sub-directories are mainly configured with cypress.config.js using CommonJS require and no specification of the type field in their respective package.json file

  • The Node.js documentation explains in Modules: CommonJS modules

    CommonJS modules are the original way to package JavaScript code for Node.js.

    and in Modules: ECMAScript modules

    ECMAScript modules are the official standard format to package JavaScript code for reuse.

Change

Where necessary in examples sub-directories:

  • add "type": "module" to package.json files
  • convert cypress.config.js files from require (CommonJS) to import (ESM)
  • convert any other CommonJS source files used in examples to ESM

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 added the type: enhancement New feature or request label Mar 3, 2026
@MikeMcC399 MikeMcC399 self-assigned this Mar 3, 2026
@MikeMcC399 MikeMcC399 marked this pull request as ready for review March 3, 2026 08:56
@MikeMcC399 MikeMcC399 mentioned this pull request Mar 3, 2026
@jennifer-shehane jennifer-shehane merged commit 759ca06 into cypress-io:master Mar 3, 2026
88 checks passed
@MikeMcC399 MikeMcC399 deleted the examples-esm-upgrade branch March 3, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants