Skip to content

doc: guide for runtime-specific conditional exports using --import #59066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Momena-akhtar
Copy link

Description

This PR adds a documentation guide for simulating runtime-specific conditional exports (e.g. for Electron) using --import.

It replaces the previously proposed registerCondition feature by showing a userland alternative that works without modifying Node.js core.

📄 File added: doc/contributing/runtime-conditional-exports.md

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/tsc

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Jul 14, 2025
Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The document should be user-facing - doc/contributing is for Node.js core contributors, not users. Can you add the documentation to

### Examples
instead, following the style of other examples in the doc?

@Momena-akhtar
Copy link
Author

Surely, yes!

The document should be user-facing - doc/contributing is for Node.js core contributors, not users. Can you add the documentation to

### Examples

instead, following the style of other examples in the doc?

@Momena-akhtar
Copy link
Author

The document should be user-facing - doc/contributing is for Node.js core contributors, not users. Can you add the documentation to

### Examples

instead, following the style of other examples in the doc?

Thanks for the feedback on placement!

I've moved the runtime-specific conditional exports guide to the appropriate location under doc/api/esm.md, following the examples section. The new PR can be found at #59075 .

Closing this one in favor of the updated version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants