Skip to content
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

allow running the react-refresh transformer in custom NODE_ENVs #9977

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

ahixon-atlassian
Copy link

↪️ Pull Request

Instead of running the transformer only when NODE_ENV=development, we now only run it as long as the environment is not production.

It also explicitly exclude CSS files, since they might have a React dependency but they're not script files. If there's a better way to do this, please let me know!

💻 Examples

Running NODE_ENV=stg-east parcel --https --port 8080 --host databases.localhost will create a bundle that, at runtime, will throw the following error:

Uncaught TypeError: $RefreshSig$ is not a function

🚨 Test instructions

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

This change means that we will now run the transformer if Parcel was run with a custom environment.

We now also exclude CSS files, since they might have a React dependency but they're not script files.
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