Skip to content

Commit 29b1278

Browse files
committed
[compiler] Check for __DEV__ for FastRefresh
We don't always have the NODE_ENV set, so additionally check for the __DEV__ global if it has one set. ghstack-source-id: 3719a47 Pull Request resolved: #29785
1 parent 70194be commit 29b1278

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/packages/babel-plugin-react-compiler/src/Babel/BabelPlugin.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ export default function BabelPluginReactCompiler(
3030
*/
3131
Program(prog, pass): void {
3232
let opts = parsePluginOptions(pass.opts);
33+
const isDev =
34+
(typeof __DEV__ !== "undefined" && __DEV__ === true) ||
35+
process.env["NODE_ENV"] === "development";
3336
if (
3437
opts.enableReanimatedCheck === true &&
3538
pipelineUsesReanimatedPlugin(pass.file.opts.plugins)
3639
) {
3740
opts = injectReanimatedFlag(opts);
3841
}
39-
if (process.env["NODE_ENV"] === "development") {
42+
if (isDev) {
4043
opts = {
4144
...opts,
4245
environment: {

0 commit comments

Comments
 (0)