react / react/metro

[Feature] Pass through environment variables

Open
#634 1 comment 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.6k
Forks
696
Avg merge
8m
Merged PRs (30d)
7

Description

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
Environment variables set outside of metro server are not available in the initial bundle of the

What is the expected behavior?
Webpack allows explicit environment variable pass through to bundle via a plugin.
https://webpack.js.org/plugins/environment-plugin/

I'd like this sort of thing to be supported in metro too.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no Metro file or test; begin by reading Metro's bundler configuration and the linked webpack EnvironmentPlugin behavior. Done means establishing explicit environment-variable pass-through and verifying that those variables are available in the initial bundle.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.