@codemoreira/esad 2.0.1-28 → 2.0.1-29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/plugin/env-shim.js +10 -11
package/package.json
CHANGED
package/src/plugin/env-shim.js
CHANGED
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
* ESAD Runtime Environment Shim
|
|
3
3
|
* Injected at the very beginning of the bundle to prevent "TypeError: right operand of 'in' is not an object"
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
globalObj.process = { env: {} };
|
|
9
|
-
} else if (!process.env) {
|
|
10
|
-
process.env = {};
|
|
5
|
+
var g = typeof globalThis !== 'undefined' ? globalThis : (typeof global !== 'undefined' ? global : this);
|
|
6
|
+
if (!g['process']) {
|
|
7
|
+
g['process'] = {};
|
|
11
8
|
}
|
|
9
|
+
if (!g['process']['env']) {
|
|
10
|
+
g['process']['env'] = {};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
g['process']['env']['EXPO_OS'] = '__EXPO_OS__';
|
|
14
|
+
g['process']['env']['NODE_ENV'] = '__NODE_ENV__';
|
|
15
|
+
g['process']['env']['REPACK_PLATFORM'] = '__REPACK_PLATFORM__';
|
|
12
16
|
|
|
13
|
-
// Prevent DefinePlugin from replacing the left-hand side by using an intermediate variable and brackets
|
|
14
|
-
const e = process.env;
|
|
15
|
-
e['EXPO_OS'] = '__EXPO_OS__';
|
|
16
|
-
e['NODE_ENV'] = '__NODE_ENV__';
|
|
17
|
-
e['REPACK_PLATFORM'] = '__REPACK_PLATFORM__';
|
|
18
17
|
|