feat(core): preserve env presets instead of inlining - #1764
Conversation
8dc0348 to
b9afaa3
Compare
5b37460 to
7e8b1a9
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e8b1a99de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const processEnvDefine: ConstructorParameters< | ||
| typeof rspack.DefinePlugin | ||
| >[0] = { | ||
| 'process.env': {}, |
There was a problem hiding this comment.
Retain UMD preset values before stubbing process.env
When a UMD source reads process.env.BASE_URL or process.env.ASSET_PREFIX without a user override, those keys have already been removed from nextDefine, and this parent definition then compiles the access against an empty object, yielding undefined instead of Rsbuild's previous "/"/"" defaults. The new UMD test only detects the unrelated "production" literal, so it misses this runtime value regression; preserve these preset literals for UMD before stubbing unknown process.env properties.
Useful? React with 👍 / 👎.
7e8b1a9 to
d0b43ad
Compare
d0b43ad to
7d43494
Compare
Summary
Stop inlining Rsbuild's default env presets so downstream consumers can replace them:
process.env.BASE_URL/process.env.ASSET_PREFIX: preserved for all formats.import.meta.env.*: preserved for ESM only.Checklist