mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-18 10:20:39 +08:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
724088a810 | ||
![]() |
7c20b30c85 | ||
![]() |
6a053c6428 | ||
![]() |
f202fc590d |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-update-cli",
|
"name": "react-native-update-cli",
|
||||||
"version": "1.16.0",
|
"version": "1.18.0",
|
||||||
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@@ -49,11 +49,21 @@ async function runReactNativeBundleCommand(
|
|||||||
|
|
||||||
fs.emptyDirSync(outputFolder);
|
fs.emptyDirSync(outputFolder);
|
||||||
|
|
||||||
Array.prototype.push.apply(reactNativeBundleArgs, [
|
let cliPath = require.resolve('react-native/local-cli/cli.js', {
|
||||||
require.resolve('react-native/local-cli/cli.js', {
|
paths: [process.cwd()],
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
cliPath = require.resolve('@expo/cli', {
|
||||||
paths: [process.cwd()],
|
paths: [process.cwd()],
|
||||||
}), // 'react-native' package may be symlinked
|
});
|
||||||
'bundle',
|
} catch (e) {}
|
||||||
|
const bundleCommand = cliPath.includes('@expo/cli')
|
||||||
|
? 'export:embed'
|
||||||
|
: 'bundle';
|
||||||
|
|
||||||
|
Array.prototype.push.apply(reactNativeBundleArgs, [
|
||||||
|
cliPath,
|
||||||
|
bundleCommand,
|
||||||
'--assets-dest',
|
'--assets-dest',
|
||||||
outputFolder,
|
outputFolder,
|
||||||
'--bundle-output',
|
'--bundle-output',
|
||||||
@@ -173,7 +183,11 @@ async function compileHermesByteCode(
|
|||||||
) {
|
) {
|
||||||
console.log(`Hermes enabled, now compiling to hermes bytecode:\n`);
|
console.log(`Hermes enabled, now compiling to hermes bytecode:\n`);
|
||||||
// >= rn 0.69
|
// >= rn 0.69
|
||||||
const rnDir = path.dirname(require.resolve('react-native'));
|
const rnDir = path.dirname(
|
||||||
|
require.resolve('react-native', {
|
||||||
|
paths: [process.cwd()],
|
||||||
|
}),
|
||||||
|
);
|
||||||
const hermesCommand = path.join(
|
const hermesCommand = path.join(
|
||||||
rnDir,
|
rnDir,
|
||||||
`/sdks/hermesc/${getHermesOSBin()}/hermesc`,
|
`/sdks/hermesc/${getHermesOSBin()}/hermesc`,
|
||||||
@@ -200,7 +214,10 @@ async function compileHermesByteCode(
|
|||||||
if (sourcemapOutput) {
|
if (sourcemapOutput) {
|
||||||
args.push('-output-source-map');
|
args.push('-output-source-map');
|
||||||
}
|
}
|
||||||
spawnSync(path.join.apply(null, hermesCommand.split('/')), args, {
|
console.log(
|
||||||
|
'Running hermesc: ' + hermesCommand + ' ' + args.join(' ') + '\n',
|
||||||
|
);
|
||||||
|
spawnSync(hermesCommand, args, {
|
||||||
stdio: 'ignore',
|
stdio: 'ignore',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user