@codemoreira/esad 2.0.1-15 → 2.0.1-17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemoreira/esad",
3
- "version": "2.0.1-15",
3
+ "version": "2.0.1-17",
4
4
  "description": "Easy Super App Development - Zero-Config CLI and DevTools for React Native Module Federation",
5
5
  "main": "src/plugin/index.js",
6
6
  "types": "./src/plugin/index.d.ts",
@@ -20,6 +20,11 @@ const { ProvidePlugin, DefinePlugin } = require('@rspack/core');
20
20
  function withESAD(env, options) {
21
21
  const { platform, dev } = env;
22
22
  const isDev = dev !== false;
23
+
24
+ // Force environment variables for babel-preset-expo and other loaders
25
+ process.env.EXPO_OS = platform;
26
+ process.env.NODE_ENV = isDev ? 'development' : 'production';
27
+ process.env.BABEL_ENV = isDev ? 'development' : 'production';
23
28
  const dirname = options.dirname;
24
29
  const pkgPath = path.resolve(dirname, 'package.json');
25
30
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
@@ -98,13 +103,15 @@ function withESAD(env, options) {
98
103
  ],
99
104
  },
100
105
  plugins: [
101
- new ProvidePlugin({
102
- process: 'process/browser',
103
- }),
104
106
  new DefinePlugin({
105
107
  'process.env.NODE_ENV': JSON.stringify(isDev ? 'development' : 'production'),
106
108
  'process.env.EXPO_OS': JSON.stringify(platform),
107
109
  'process.env.REPACK_PLATFORM': JSON.stringify(platform),
110
+ 'process.env': JSON.stringify({
111
+ NODE_ENV: isDev ? 'development' : 'production',
112
+ EXPO_OS: platform,
113
+ REPACK_PLATFORM: platform,
114
+ }),
108
115
  '__DEV__': JSON.stringify(isDev),
109
116
  }),
110
117
  new ExpoModulesPlugin(),