react-native-update-cli 1.17.0 → 1.18.0
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/lib/bundle.js +12 -4
- package/package.json +1 -1
- package/src/bundle.js +18 -5
package/lib/bundle.js
CHANGED
|
@@ -56,10 +56,17 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
|
|
|
56
56
|
|
|
57
57
|
fs.emptyDirSync(outputFolder);
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
let cliPath = require.resolve('react-native/local-cli/cli.js', {
|
|
60
60
|
paths: [process.cwd()]
|
|
61
|
-
})
|
|
62
|
-
|
|
61
|
+
});
|
|
62
|
+
try {
|
|
63
|
+
cliPath = require.resolve('@expo/cli', {
|
|
64
|
+
paths: [process.cwd()]
|
|
65
|
+
});
|
|
66
|
+
} catch (e) {}
|
|
67
|
+
const bundleCommand = cliPath.includes('@expo/cli') ? 'export:embed' : 'bundle';
|
|
68
|
+
|
|
69
|
+
Array.prototype.push.apply(reactNativeBundleArgs, [cliPath, bundleCommand, '--assets-dest', outputFolder, '--bundle-output', path.join(outputFolder, bundleName), '--dev', development, '--entry-file', entryFile, '--platform', platform, '--reset-cache']);
|
|
63
70
|
|
|
64
71
|
if (sourcemapOutput) {
|
|
65
72
|
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
@@ -160,7 +167,8 @@ async function compileHermesByteCode(bundleName, outputFolder, sourcemapOutput)
|
|
|
160
167
|
if (sourcemapOutput) {
|
|
161
168
|
args.push('-output-source-map');
|
|
162
169
|
}
|
|
163
|
-
|
|
170
|
+
console.log('Running hermesc: ' + hermesCommand + ' ' + args.join(' ') + '\n');
|
|
171
|
+
spawnSync(hermesCommand, args, {
|
|
164
172
|
stdio: 'ignore'
|
|
165
173
|
});
|
|
166
174
|
}
|
package/package.json
CHANGED
package/src/bundle.js
CHANGED
|
@@ -49,11 +49,21 @@ async function runReactNativeBundleCommand(
|
|
|
49
49
|
|
|
50
50
|
fs.emptyDirSync(outputFolder);
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
let cliPath = require.resolve('react-native/local-cli/cli.js', {
|
|
53
|
+
paths: [process.cwd()],
|
|
54
|
+
});
|
|
55
|
+
try {
|
|
56
|
+
cliPath = require.resolve('@expo/cli', {
|
|
54
57
|
paths: [process.cwd()],
|
|
55
|
-
})
|
|
56
|
-
|
|
58
|
+
});
|
|
59
|
+
} catch (e) {}
|
|
60
|
+
const bundleCommand = cliPath.includes('@expo/cli')
|
|
61
|
+
? 'export:embed'
|
|
62
|
+
: 'bundle';
|
|
63
|
+
|
|
64
|
+
Array.prototype.push.apply(reactNativeBundleArgs, [
|
|
65
|
+
cliPath,
|
|
66
|
+
bundleCommand,
|
|
57
67
|
'--assets-dest',
|
|
58
68
|
outputFolder,
|
|
59
69
|
'--bundle-output',
|
|
@@ -204,7 +214,10 @@ async function compileHermesByteCode(
|
|
|
204
214
|
if (sourcemapOutput) {
|
|
205
215
|
args.push('-output-source-map');
|
|
206
216
|
}
|
|
207
|
-
|
|
217
|
+
console.log(
|
|
218
|
+
'Running hermesc: ' + hermesCommand + ' ' + args.join(' ') + '\n',
|
|
219
|
+
);
|
|
220
|
+
spawnSync(hermesCommand, args, {
|
|
208
221
|
stdio: 'ignore',
|
|
209
222
|
});
|
|
210
223
|
}
|