1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-18 01:26:10 +08:00
Code Issues 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

@@ -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');

View File

@@ -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);
});
};