react-native-update-cli 1.39.0 → 1.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/bundle.js
CHANGED
|
@@ -135,7 +135,6 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
const bundleParams = await (0, _utils.checkPlugins)();
|
|
138
|
-
const minifyOption = bundleParams.minify;
|
|
139
138
|
const isSentry = bundleParams.sentry;
|
|
140
139
|
const bundleCommand = usingExpo ? 'export:embed' : platform === 'harmony' ? 'bundle-harmony' : 'bundle';
|
|
141
140
|
if (platform === 'harmony') {
|
|
@@ -167,9 +166,7 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
|
|
|
167
166
|
entryFile,
|
|
168
167
|
'--platform',
|
|
169
168
|
platform,
|
|
170
|
-
'--reset-cache'
|
|
171
|
-
'--minify',
|
|
172
|
-
minifyOption
|
|
169
|
+
'--reset-cache'
|
|
173
170
|
]);
|
|
174
171
|
if (sourcemapOutput) {
|
|
175
172
|
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
@@ -392,7 +389,7 @@ async function pack(dir, output) {
|
|
|
392
389
|
}
|
|
393
390
|
const childs = _fsextra.readdirSync(root);
|
|
394
391
|
for (const name of childs){
|
|
395
|
-
if (name === '.' || name === '..' || name === 'index.bundlejs.map') {
|
|
392
|
+
if (name === '.' || name === '..' || name === 'index.bundlejs.map' || name === 'index.bundlejs.txt.map') {
|
|
396
393
|
continue;
|
|
397
394
|
}
|
|
398
395
|
const fullPath = _nodepath.default.join(root, name);
|
|
@@ -704,12 +701,12 @@ function diffArgsCheck(args, options, diffFn) {
|
|
|
704
701
|
const commands = {
|
|
705
702
|
bundle: async function({ options }) {
|
|
706
703
|
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
707
|
-
const { bundleName, entryFile, intermediaDir, output, dev } = (0, _utils.translateOptions)({
|
|
704
|
+
const { bundleName, entryFile, intermediaDir, output, dev, sourcemap } = (0, _utils.translateOptions)({
|
|
708
705
|
...options,
|
|
709
706
|
platform
|
|
710
707
|
});
|
|
711
708
|
const bundleParams = await (0, _utils.checkPlugins)();
|
|
712
|
-
const
|
|
709
|
+
const sourcemapPlugin = bundleParams.sourcemap;
|
|
713
710
|
const isSentry = bundleParams.sentry;
|
|
714
711
|
const sourcemapOutput = _nodepath.default.join(intermediaDir, `${bundleName}.map`);
|
|
715
712
|
const realOutput = output.replace(/\$\{time\}/g, `${Date.now()}`);
|
|
@@ -718,7 +715,7 @@ const commands = {
|
|
|
718
715
|
}
|
|
719
716
|
const { version, major, minor } = (0, _utils.getRNVersion)();
|
|
720
717
|
console.log(`Bundling with react-native: ${version}`);
|
|
721
|
-
await runReactNativeBundleCommand(bundleName, dev, entryFile, intermediaDir, platform, sourcemap ? sourcemapOutput : '');
|
|
718
|
+
await runReactNativeBundleCommand(bundleName, dev, entryFile, intermediaDir, platform, sourcemap || sourcemapPlugin ? sourcemapOutput : '');
|
|
722
719
|
await pack(_nodepath.default.resolve(intermediaDir), realOutput);
|
|
723
720
|
const v = await (0, _utils.question)('是否现在上传此热更包?(Y/N)');
|
|
724
721
|
if (v.toLowerCase() === 'y') {
|
package/package.json
CHANGED
package/src/bundle.js
CHANGED
|
@@ -87,7 +87,6 @@ async function runReactNativeBundleCommand(
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
const bundleParams = await checkPlugins();
|
|
90
|
-
const minifyOption = bundleParams.minify;
|
|
91
90
|
const isSentry = bundleParams.sentry;
|
|
92
91
|
const bundleCommand = usingExpo
|
|
93
92
|
? 'export:embed'
|
|
@@ -126,8 +125,6 @@ async function runReactNativeBundleCommand(
|
|
|
126
125
|
'--platform',
|
|
127
126
|
platform,
|
|
128
127
|
'--reset-cache',
|
|
129
|
-
'--minify',
|
|
130
|
-
minifyOption,
|
|
131
128
|
]);
|
|
132
129
|
|
|
133
130
|
if (sourcemapOutput) {
|
|
@@ -420,7 +417,7 @@ async function pack(dir, output) {
|
|
|
420
417
|
}
|
|
421
418
|
const childs = fs.readdirSync(root);
|
|
422
419
|
for (const name of childs) {
|
|
423
|
-
if (name === '.' || name === '..' || name === 'index.bundlejs.map') {
|
|
420
|
+
if (name === '.' || name === '..' || name === 'index.bundlejs.map' || name === 'index.bundlejs.txt.map') {
|
|
424
421
|
continue;
|
|
425
422
|
}
|
|
426
423
|
const fullPath = path.join(root, name);
|
|
@@ -814,14 +811,14 @@ export const commands = {
|
|
|
814
811
|
options.platform || (await question('平台(ios/android/harmony):')),
|
|
815
812
|
);
|
|
816
813
|
|
|
817
|
-
const { bundleName, entryFile, intermediaDir, output, dev } =
|
|
814
|
+
const { bundleName, entryFile, intermediaDir, output, dev, sourcemap } =
|
|
818
815
|
translateOptions({
|
|
819
816
|
...options,
|
|
820
817
|
platform,
|
|
821
818
|
});
|
|
822
819
|
|
|
823
820
|
const bundleParams = await checkPlugins();
|
|
824
|
-
const
|
|
821
|
+
const sourcemapPlugin = bundleParams.sourcemap;
|
|
825
822
|
const isSentry = bundleParams.sentry;
|
|
826
823
|
|
|
827
824
|
const sourcemapOutput = path.join(intermediaDir, `${bundleName}.map`);
|
|
@@ -842,7 +839,7 @@ export const commands = {
|
|
|
842
839
|
entryFile,
|
|
843
840
|
intermediaDir,
|
|
844
841
|
platform,
|
|
845
|
-
sourcemap ? sourcemapOutput : '',
|
|
842
|
+
sourcemap || sourcemapPlugin ? sourcemapOutput : '',
|
|
846
843
|
);
|
|
847
844
|
|
|
848
845
|
await pack(path.resolve(intermediaDir), realOutput);
|
|
@@ -2,7 +2,6 @@ import { plugins } from './plugin-config';
|
|
|
2
2
|
|
|
3
3
|
interface BundleParams {
|
|
4
4
|
sentry: boolean;
|
|
5
|
-
minify: boolean;
|
|
6
5
|
sourcemap: boolean;
|
|
7
6
|
[key: string]: any;
|
|
8
7
|
}
|
|
@@ -10,7 +9,6 @@ interface BundleParams {
|
|
|
10
9
|
export async function checkPlugins(): Promise<BundleParams> {
|
|
11
10
|
const params: BundleParams = {
|
|
12
11
|
sentry: false,
|
|
13
|
-
minify: true,
|
|
14
12
|
sourcemap: false,
|
|
15
13
|
};
|
|
16
14
|
|
|
@@ -3,7 +3,6 @@ import fs from 'fs-extra';
|
|
|
3
3
|
interface PluginConfig {
|
|
4
4
|
name: string;
|
|
5
5
|
bundleParams?: {
|
|
6
|
-
minify?: boolean;
|
|
7
6
|
[key: string]: any;
|
|
8
7
|
};
|
|
9
8
|
detect: () => Promise<boolean>;
|
|
@@ -14,7 +13,6 @@ export const plugins: PluginConfig[] = [
|
|
|
14
13
|
name: 'sentry',
|
|
15
14
|
bundleParams: {
|
|
16
15
|
sentry: true,
|
|
17
|
-
minify: false,
|
|
18
16
|
sourcemap: true,
|
|
19
17
|
},
|
|
20
18
|
detect: async () => {
|