@codemoreira/esad 2.0.1-7 → 2.0.1-9
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/cli/utils/scaffold.js +10 -0
- package/src/plugin/index.js +4 -5
package/package.json
CHANGED
|
@@ -85,6 +85,16 @@ async function prepareNative(cwd, platform = 'android') {
|
|
|
85
85
|
await fs.writeFile(buildGradlePath, content);
|
|
86
86
|
console.log(`✅ Patched android/app/build.gradle for Re.Pack and AndroidX versions.`);
|
|
87
87
|
}
|
|
88
|
+
|
|
89
|
+
const gradlePropsPath = path.join(androidDir, 'gradle.properties');
|
|
90
|
+
if (fs.existsSync(gradlePropsPath)) {
|
|
91
|
+
let props = await fs.readFile(gradlePropsPath, 'utf8');
|
|
92
|
+
if (!props.includes('newArchEnabled=true')) {
|
|
93
|
+
props += '\nnewArchEnabled=true\n';
|
|
94
|
+
await fs.writeFile(gradlePropsPath, props);
|
|
95
|
+
console.log(`✅ Enabled New Architecture in android/gradle.properties.`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
// Create react-native.config.js if missing
|
package/src/plugin/index.js
CHANGED
|
@@ -64,7 +64,7 @@ function withESAD(env, options) {
|
|
|
64
64
|
type: 'javascript/auto',
|
|
65
65
|
resolve: { fullySpecified: false },
|
|
66
66
|
use: {
|
|
67
|
-
loader: 'babel-loader',
|
|
67
|
+
loader: '@callstack/repack/babel-swc-loader',
|
|
68
68
|
options: {
|
|
69
69
|
babelrc: false,
|
|
70
70
|
configFile: false,
|
|
@@ -82,11 +82,10 @@ function withESAD(env, options) {
|
|
|
82
82
|
exclude: [/node_modules/],
|
|
83
83
|
type: 'javascript/auto',
|
|
84
84
|
use: {
|
|
85
|
-
loader: 'babel-loader',
|
|
85
|
+
loader: '@callstack/repack/babel-swc-loader',
|
|
86
86
|
options: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
presets: ['@react-native/babel-preset'],
|
|
87
|
+
// Allow project-level babel.config.js to be applied
|
|
88
|
+
babelrc: true,
|
|
90
89
|
sourceType: 'unambiguous',
|
|
91
90
|
caller: { name: 'repack' },
|
|
92
91
|
},
|