@codemoreira/esad 2.0.1-34 → 2.0.1-35

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-34",
3
+ "version": "2.0.1-35",
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",
@@ -53,7 +53,8 @@
53
53
  "@callstack/repack": "^5.2.5",
54
54
  "@module-federation/enhanced": "^2.4.0",
55
55
  "@rspack/core": "^1.7.8",
56
- "babel-preset-expo": "~12.0.0",
57
- "@types/react": "~18.3.12"
56
+ "@types/react": "~18.3.12",
57
+ "babel-plugin-transform-define": "^2.1.4",
58
+ "babel-preset-expo": "~12.0.0"
58
59
  }
59
60
  }
@@ -14,6 +14,8 @@ function withESAD(env, options) {
14
14
  const { platform, dev } = env;
15
15
  const isDev = dev !== false;
16
16
 
17
+ process.env.EXPO_OS = platform;
18
+
17
19
  const dirname = options.dirname;
18
20
  const pkgPath = path.resolve(dirname, 'package.json');
19
21
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
@@ -40,7 +42,20 @@ function withESAD(env, options) {
40
42
  use: {
41
43
  loader: '@callstack/repack/babel-swc-loader',
42
44
  parallel: true,
43
- options: {},
45
+ options: {
46
+ env: {
47
+ EXPO_OS: platform,
48
+ },
49
+ // Injetamos um plugin extra de transformação apenas para o EXPO_OS
50
+ plugins: [
51
+ [
52
+ require.resolve('babel-plugin-transform-define'),
53
+ {
54
+ 'process.env.EXPO_OS': platform,
55
+ },
56
+ ],
57
+ ],
58
+ },
44
59
  },
45
60
  },
46
61
  ...Repack.getAssetTransformRules(),