Skip to content
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

feat: support module-sync condition when loading config if enabled #18650

Conversation

sapphi-red
Copy link
Member

Description

With this PR, users can now import variables not exposed in CJS build by require. It requires the users to enable require(esm) by setting --experimental-require-module or using Node 23+.

related #18649

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Nov 13, 2024
Comment on lines -24 to -25
"types": "./dist/node/index.d.ts",
"default": "./dist/node/index.js"
Copy link
Member Author

Choose a reason for hiding this comment

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

TypeScript can infer the position in these kind of cases.

@sapphi-red sapphi-red marked this pull request as draft November 13, 2024 04:06
@sapphi-red sapphi-red marked this pull request as ready for review November 13, 2024 05:42
bluwy
bluwy previously approved these changes Nov 25, 2024
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

We should probably merge this for Vite 6 I think since it changes the exports shape a bit

packages/vite/package.json Outdated Show resolved Hide resolved
@patak-dev patak-dev merged commit cf5028d into vitejs:main Nov 25, 2024
15 checks passed
@sapphi-red sapphi-red deleted the feat/support-module-sync-condition-when-enabled branch November 26, 2024 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants