Closed
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