Skip to content

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

Open
ahixon-atlassian wants to merge 1 commit intoparcel-bundler:v2from
ahixon-atlassian:v2
Open

allow running the react-refresh transformer in custom NODE_ENVs#9977
ahixon-atlassian wants to merge 1 commit intoparcel-bundler:v2from
ahixon-atlassian:v2

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