@codemoreira/esad 2.0.1-16 → 2.0.1-18
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/index.js +11 -4
package/package.json
CHANGED
package/src/plugin/index.js
CHANGED
|
@@ -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'));
|
|
@@ -69,10 +74,10 @@ function withESAD(env, options) {
|
|
|
69
74
|
babelrc: false,
|
|
70
75
|
configFile: false,
|
|
71
76
|
presets: [
|
|
72
|
-
'babel-preset-expo',
|
|
77
|
+
['babel-preset-expo', { platform }],
|
|
73
78
|
],
|
|
74
79
|
sourceType: 'unambiguous',
|
|
75
|
-
caller: { name: 'repack' },
|
|
80
|
+
caller: { name: 'repack', platform },
|
|
76
81
|
},
|
|
77
82
|
},
|
|
78
83
|
},
|
|
@@ -84,10 +89,12 @@ function withESAD(env, options) {
|
|
|
84
89
|
use: {
|
|
85
90
|
loader: '@callstack/repack/babel-swc-loader',
|
|
86
91
|
options: {
|
|
87
|
-
// Allow project-level babel.config.js to be applied
|
|
88
92
|
babelrc: true,
|
|
89
93
|
sourceType: 'unambiguous',
|
|
90
|
-
|
|
94
|
+
presets: [
|
|
95
|
+
['babel-preset-expo', { platform }],
|
|
96
|
+
],
|
|
97
|
+
caller: { name: 'repack', platform },
|
|
91
98
|
},
|
|
92
99
|
},
|
|
93
100
|
},
|