Skip to content

Merge selected environment config into __CONF__#710

Merged
rzueger merged 1 commit intodevelopfrom
chore/webpack-env-merge
Apr 19, 2026
Merged

Merge selected environment config into __CONF__#710
rzueger merged 1 commit intodevelopfrom
chore/webpack-env-merge

Conversation

@rzueger
Copy link
Copy Markdown
Member

@rzueger rzueger commented Apr 19, 2026

Summary

  • Keys defined under projectConf.environments.<env> now override the top-level config before it is packinized into __CONF__.
  • Clients can read env-specific flags via __CONF__.<key> directly.
  • Enables per-environment feature toggles without introducing new webpack globals.

Motivation

Today webpack already picks the per-environment block (test vs production) to derive the Firebase globals (__FIREBASE_PROJECT_ID__, etc.). But everything else in __CONF__ is project-wide. If a project wants an opt-in flag that is true in test and false in prod (or vice versa), the only way is another top-level webpack global — which doesn't scale.

With this change, a project can define under environments.test (or environments.production) any key that is also accepted at the top level, and the selected environment's value wins at build time.

Test plan

  • npm test — all 1806 tests pass
  • npm run typecheck clean
  • npm run build --project=<any> produces a working bundle
  • No observable change for any existing project — no env block currently defines keys that collide with top-level config

Keys defined under projectConf.environments.<env> now override the
top-level config before it is packinized into __CONF__, letting the
client read env-specific flags via __CONF__.<key>. Enables per-env
feature toggles without introducing new webpack globals.
@rzueger rzueger merged commit 657cb16 into develop Apr 19, 2026
2 checks passed
@rzueger rzueger deleted the chore/webpack-env-merge branch April 19, 2026 07:36
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