1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
tdzl2003 2016-08-14 00:58:34 +08:00
parent b08b1b1126
commit 28d9653f6c
4 changed files with 37 additions and 17 deletions

View File

@ -6,6 +6,8 @@
因为React Native调整了okhttp的依赖对于0.27以上版本的React Native请安装1.1.x版本对于0.26及以前版本请安装1.0.x版本。 因为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。 1. 命令行工具&网页双端管理版本发布过程简单便捷完全可以集成CI。

View File

@ -365,22 +365,40 @@ export const commands = {
const Config = require(path.resolve('node_modules/react-native/local-cli/util/Config')); 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 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([ if (bundle.func) {
'--entry-file', // React native after 0.31.0
entryFile, await bundle.func([], defaultConfig, {
'--platform', entryFile : entryFile,
platform, platform: platform,
'--dev', dev: !!dev,
'' + !!dev, bundleOutput: `${realIntermedia}${path.sep}index.bundlejs`,
'--bundle-output', assetsDest: `${realIntermedia}`,
`${realIntermedia}${path.sep}index.bundlejs`, verbose: !!verbose,
'--assets-dest', transformer: require.resolve('react-native/packager/transformer'),
`${realIntermedia}`, bundleEncoding: 'utf8',
'--verbose', });
'' + !!verbose, } else {
], Config.get(path.resolve('node_modules/react-native/local-cli'), defaultConfig)); // 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'); console.log('Packing');

View File

@ -33,7 +33,7 @@ exports.run = function () {
console.log('Not loggined.\nRun `pushy login` at your project directory to login.'); console.log('Not loggined.\nRun `pushy login` at your project directory to login.');
return; return;
} }
console.error(err.message); console.error(err.stack);
process.exit(-1); process.exit(-1);
}); });
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "react-native-update", "name": "react-native-update",
"version": "2.0.1", "version": "2.1.0",
"description": "react-native hot update", "description": "react-native hot update",
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {