| 1 | /* eslint-disable */ |
| 2 | |
| 3 | const NODE_ENV = process.env.NODE_ENV; |
| 4 | if (NODE_ENV !== 'development' && NODE_ENV !== 'production') { |
| 5 | throw new Error('NODE_ENV must either be set to development or production.'); |
| 6 | } |
| 7 | global.__DEV__ = NODE_ENV === 'development'; |
| 8 | global.__EXTENSION__ = false; |
| 9 | global.__TEST__ = NODE_ENV === 'test'; |
| 10 | global.__PROFILE__ = NODE_ENV === 'development'; |
| 11 | |
| 12 | const RELEASE_CHANNEL = process.env.RELEASE_CHANNEL; |
| 13 | |
| 14 | // Default to running tests in experimental mode. If the release channel is |
| 15 | // set via an environment variable, then check if it's "experimental". |
| 16 | global.__EXPERIMENTAL__ = |
| 17 | typeof RELEASE_CHANNEL === 'string' |
| 18 | ? RELEASE_CHANNEL === 'experimental' |
| 19 | : true; |
| 20 | |
| 21 | global.__VARIANT__ = !!process.env.VARIANT; |
| 22 | |
| 23 | if (typeof window !== 'undefined') { |
| 24 | } else { |
| 25 | global.AbortController = |
| 26 | require('abortcontroller-polyfill/dist/cjs-ponyfill').AbortController; |
| 27 | } |