11import path from 'node:path' ;
2- import { getRNVersion , translateOptions } from './utils' ;
2+ import { translateOptions } from './utils' ;
33import * as fs from 'fs-extra' ;
44import { ZipFile } from 'yazl' ;
55import { open as openZipFile } from 'yauzl' ;
@@ -10,6 +10,7 @@ import semverSatisfies from 'semver/functions/satisfies';
1010const g2js = require ( 'gradle-to-js/lib/parser' ) ;
1111import os from 'node:os' ;
1212const properties = require ( 'properties' ) ;
13+ import { depVersions } from './utils/dep-versions' ;
1314
1415let bsdiff ;
1516let hdiff ;
@@ -82,11 +83,13 @@ async function runReactNativeBundleCommand({
8283 paths : [ process . cwd ( ) ] ,
8384 } ) ;
8485 const expoCliVersion = JSON . parse (
85- fs . readFileSync (
86- require . resolve ( '@expo/cli/package.json' , {
87- paths : [ process . cwd ( ) ] ,
88- } ) ,
89- ) . toString ( ) ,
86+ fs
87+ . readFileSync (
88+ require . resolve ( '@expo/cli/package.json' , {
89+ paths : [ process . cwd ( ) ] ,
90+ } ) ,
91+ )
92+ . toString ( ) ,
9093 ) . version ;
9194 // expo cli 0.10.17 (expo 49) 开始支持 bundle:embed
9295 if ( semverSatisfies ( expoCliVersion , '>= 0.10.17' ) ) {
@@ -175,19 +178,11 @@ async function runReactNativeBundleCommand({
175178 platform ,
176179 '--reset-cache' ,
177180 ] ) ;
178-
181+
179182 if ( cli . taro ) {
180- reactNativeBundleArgs . push ( ...[
181- '--type' ,
182- 'rn' ,
183- ] )
183+ reactNativeBundleArgs . push ( ...[ '--type' , 'rn' ] ) ;
184184 } else {
185- reactNativeBundleArgs . push ( ...[
186- '--dev' ,
187- dev ,
188- '--entry-file' ,
189- entryFile ,
190- ] )
185+ reactNativeBundleArgs . push ( ...[ '--dev' , dev , '--entry-file' , entryFile ] ) ;
191186 }
192187
193188 if ( sourcemapOutput ) {
@@ -927,9 +922,7 @@ export const commands = {
927922 throw new Error ( 'Platform must be specified.' ) ;
928923 }
929924
930- const { version, major, minor } = getRNVersion ( ) ;
931-
932- console . log ( `Bundling with react-native: ${ version } ` ) ;
925+ console . log ( `Bundling with react-native: ${ depVersions [ 'react-native' ] } ` ) ;
933926
934927 await runReactNativeBundleCommand ( {
935928 bundleName,
0 commit comments