-
Notifications
You must be signed in to change notification settings - Fork 505
Closed
Labels
kind: featureNew feature or requestNew feature or requestsolution: intended behaviorThis is not a bug and is expected behaviorThis is not a bug and is expected behaviorsolution: unresolvedIssue has been closed by OP but root cause has not necessarily been resolvedIssue has been closed by OP but root cause has not necessarily been resolvedsolution: workaround availableThere is a workaround available for this issueThere is a workaround available for this issue
Description
Current Behavior
babel-plugin-dev-expression
replaces all instances of __DEV__
with process.env.NODE_ENV !== 'production'
. As the process variable may not be available outside of nodejs, it introduces an incompatibility with modern browsers.
Suggested solution(s)
There are several different ways we could approach fixing this:
- Add an option to
tsdx.config.js
that allows users to opt out ofbabel-plugin-dev-expression
, or replace with a different plugin. - Replace
babel-plugin-dev-expression
with another plugin that works in both browser and nodejs environments. I made a quick fork of babel-plugin-dev-expression that does just that.
Additional context
Affects these issues:
immer
an open issue in
babel-plugin-dev-expression
Metadata
Metadata
Assignees
Labels
kind: featureNew feature or requestNew feature or requestsolution: intended behaviorThis is not a bug and is expected behaviorThis is not a bug and is expected behaviorsolution: unresolvedIssue has been closed by OP but root cause has not necessarily been resolvedIssue has been closed by OP but root cause has not necessarily been resolvedsolution: workaround availableThere is a workaround available for this issueThere is a workaround available for this issue