Skip to content

Conversation

yaacovCR
Copy link

the latest version of graphql-js on main is dual esm/cjs build with proper exports map.

graphql/graphql-js#4464 adds development mode via custom condition

This PR demonstrates how a consumer of graphql-js might setup jest/ts-jest: simply add the custom exports conditions development (while retaining node) via the jest config testEnvironmentOptions / customExportConditions

Compare with earlier attempts for the previously proposed esm-only #8082 and #8083 which requires babel or swc => retaining the dual build simplifies these changes.

Copy link

codesandbox-ci bot commented Aug 18, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@yaacovCR yaacovCR force-pushed the test-esm branch 2 times, most recently from 4606a3c to e35e9f9 Compare August 18, 2025 01:23
@yaacovCR yaacovCR closed this Aug 18, 2025
- use jest config setting: testEnvironment / customExportConditions
- use latest dev mode with dual build (see graphql/graphql-js#4464)
- no need for additional transformer
@yaacovCR yaacovCR reopened this Aug 18, 2025
@yaacovCR
Copy link
Author

@yaacovCR
Copy link
Author

@glasser

@yaacovCR yaacovCR closed this Aug 18, 2025
@yaacovCR yaacovCR reopened this Aug 18, 2025
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.

1 participant