mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	fix #21
This commit is contained in:
		| @@ -6,6 +6,8 @@ | ||||
|  | ||||
| 因为React Native调整了okhttp的依赖,对于0.27以上版本的React Native,请安装1.1.x版本,对于0.26及以前版本,请安装1.0.x版本。 | ||||
|  | ||||
| 0.31开始React Native调整了bundle的传参,因此需要更新本插件到2.1.0 | ||||
|  | ||||
| ### 优势 | ||||
|  | ||||
| 1. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成CI。 | ||||
|   | ||||
| @@ -365,22 +365,40 @@ export const commands = { | ||||
|  | ||||
|     const Config = require(path.resolve('node_modules/react-native/local-cli/util/Config')); | ||||
|     const bundle = require(path.resolve('node_modules/react-native/local-cli/bundle/bundle')); | ||||
|     const defaultConfig = require(path.resolve('node_modules/react-native/local-cli/default.config')); | ||||
|     const defaultConfig = | ||||
|       Config.get(path.resolve('node_modules/react-native/local-cli'), | ||||
|         require(path.resolve('node_modules/react-native/local-cli/default.config')) | ||||
|       ); | ||||
|  | ||||
|     await bundle([ | ||||
|       '--entry-file', | ||||
|       entryFile, | ||||
|       '--platform', | ||||
|       platform, | ||||
|       '--dev', | ||||
|       '' + !!dev, | ||||
|       '--bundle-output', | ||||
|       `${realIntermedia}${path.sep}index.bundlejs`, | ||||
|       '--assets-dest', | ||||
|       `${realIntermedia}`, | ||||
|       '--verbose', | ||||
|       '' + !!verbose, | ||||
|     ], Config.get(path.resolve('node_modules/react-native/local-cli'), defaultConfig)); | ||||
|     if (bundle.func) { | ||||
|       // React native after 0.31.0 | ||||
|       await bundle.func([], defaultConfig, { | ||||
|         entryFile : entryFile, | ||||
|         platform: platform, | ||||
|         dev: !!dev, | ||||
|         bundleOutput: `${realIntermedia}${path.sep}index.bundlejs`, | ||||
|         assetsDest: `${realIntermedia}`, | ||||
|         verbose: !!verbose, | ||||
|         transformer: require.resolve('react-native/packager/transformer'), | ||||
|         bundleEncoding: 'utf8', | ||||
|       }); | ||||
|     } else { | ||||
|       // React native before 0.30.0 | ||||
|       await bundle([ | ||||
|         '--entry-file', | ||||
|         entryFile, | ||||
|         '--platform', | ||||
|         platform, | ||||
|         '--dev', | ||||
|         '' + !!dev, | ||||
|         '--bundle-output', | ||||
|         `${realIntermedia}${path.sep}index.bundlejs`, | ||||
|         '--assets-dest', | ||||
|         `${realIntermedia}`, | ||||
|         '--verbose', | ||||
|         '' + !!verbose, | ||||
|       ], defaultConfig); | ||||
|     } | ||||
|  | ||||
|     console.log('Packing'); | ||||
|  | ||||
|   | ||||
| @@ -33,7 +33,7 @@ exports.run = function () { | ||||
|         console.log('Not loggined.\nRun `pushy login` at your project directory to login.'); | ||||
|         return; | ||||
|       } | ||||
|       console.error(err.message); | ||||
|       console.error(err.stack); | ||||
|       process.exit(-1); | ||||
|     }); | ||||
| }; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "react-native-update", | ||||
|   "version": "2.0.1", | ||||
|   "version": "2.1.0", | ||||
|   "description": "react-native hot update", | ||||
|   "main": "lib/index.js", | ||||
|   "scripts": { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 tdzl2003
					tdzl2003