Skip to content

feat(core): preserve env presets instead of inlining#1764

Draft
elecmonkey wants to merge 1 commit into
mainfrom
elecmonkey/preserve-env-define
Draft

feat(core): preserve env presets instead of inlining#1764
elecmonkey wants to merge 1 commit into
mainfrom
elecmonkey/preserve-env-define

Conversation

@elecmonkey

@elecmonkey elecmonkey commented Jul 14, 2026

Copy link
Copy Markdown
Member

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.

Need web-infra-dev/rspack#14483

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@elecmonkey
elecmonkey force-pushed the elecmonkey/preserve-env-define branch 2 times, most recently from 8d72368 to 8dc0348 Compare July 14, 2026 08:10
Keep Rsbuild's default `process.env.*` presets from being inlined for all
formats, and `import.meta.env.*` for ESM, so downstream consumers can replace
them. Other formats keep Rsbuild's inlining since `import.meta` is invalid there.
@elecmonkey
elecmonkey force-pushed the elecmonkey/preserve-env-define branch from 8dc0348 to b9afaa3 Compare July 14, 2026 12:09
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