@codemoreira/esad 2.0.1-26 → 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 +11 -10
package/package.json
CHANGED
package/src/plugin/env-shim.js
CHANGED
|
@@ -2,15 +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__';
|
|
16
|
+
|
|
12
17
|
|
|
13
|
-
// These placeholders are replaced by Rspack's DefinePlugin during build time
|
|
14
|
-
process.env.EXPO_OS = '__EXPO_OS__';
|
|
15
|
-
process.env.NODE_ENV = '__NODE_ENV__';
|
|
16
|
-
process.env.REPACK_PLATFORM = '__REPACK_PLATFORM__';
|