Skip to content

feat(turbopack): improve compile-time define value to support more data types and expr evaluation #32

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
wants to merge 8 commits into from

Conversation

xusd320
Copy link

@xusd320 xusd320 commented Jul 9, 2025

What

Let compile-time define env supports full types of json and basical evaluation. See examples at

https://github.com/umijs/next.js/blob/feat/upstream-turboapack-define-env/turbopack/crates/turbopack-tests/tests/snapshot.rs#L261-L286

This may also improve the minification because more static informations being provided when handling define env. But this change may affect the ecmascript analysis and tree-shaking, so need a careful review.

@xusd320 xusd320 changed the title Feat/upstream turboapack define env feat(turbopack): improve compile-time define value to support more data types and expr evaluation Jul 9, 2025
@xusd320
Copy link
Author

xusd320 commented Jul 9, 2025

Upstream PR: vercel#81042

@xusd320 xusd320 requested review from elrrrrrrr and fireairforce July 9, 2025 02:17
@xusd320 xusd320 force-pushed the feat/upstream-turboapack-define-env branch from 3486fc9 to a57283a Compare July 9, 2025 02:57
@xusd320 xusd320 closed this Jul 9, 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