We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f59d961 + 5ec7287 commit 522fbd3Copy full SHA for 522fbd3
packages/node/dist/index.js
@@ -3,7 +3,7 @@
3
const NODE_ENV = process.env.NODE_ENV || "development";
4
5
function isBrowser() {
6
- return typeof window !== "undefined" && window._env && true
+ return !!(typeof window !== "undefined" && window._env)
7
}
8
9
function getFiltered() {
@@ -20,6 +20,9 @@ function getFiltered() {
20
21
function env(key = "") {
22
const safeKey = `REACT_APP_${key}`;
23
+ if (isBrowser() && key === "NODE_ENV") {
24
+ return window._env.NODE_ENV;
25
+ }
26
if (isBrowser()) {
27
return key.length ? window._env[safeKey] : window._env;
28
0 commit comments