Last active
October 8, 2022 11:13
-
-
Save pinkhominid/350e4c7fff749ba0c9c44761d97489b5 to your computer and use it in GitHub Desktop.
Browser workaround for missing process.env.NODE_ENV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hack for immer esm (see https://github.com/immerjs/immer/issues/557) | |
// and others that suffer the same | |
window.process = { ...window.process, env: { ...window?.process?.env, NODE_ENV: 'production' } }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "1.0.0", | |
"name": "node-env-hack", | |
"main": "node-env-hack.js", | |
"description": "Browser workaround for missing process.env.NODE_ENV", | |
"author": "pinkhominid <[email protected]>", | |
"license": "MIT", | |
"homepage": "https://gist.github.com/pinkhominid/350e4c7fff749ba0c9c44761d97489b5" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
npm i gist:350e4c7fff749ba0c9c44761d97489b5