Skip to content

Commit 0555005

Browse files
committed
fix: skip compose sourcemap for hermes if the sourcemap option is not enabled
1 parent a51939e commit 0555005

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/lib/cordova-utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as xml2js from "xml2js";
2-
import * as fs from "fs";
3-
import * as path from "path";
1+
import xml2js from "xml2js";
2+
import fs from "fs";
3+
import path from "path";
44

55
export function getCordovaProjectAppVersion(projectRoot?: string): Promise<string> {
66
return new Promise<string>((resolve, reject) => {

src/lib/file-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as fs from "fs";
1+
import fs from "fs";
22

33
export function isBinaryOrZip(path: string): boolean {
44
return path.search(/\.zip$/i) !== -1 || path.search(/\.apk$/i) !== -1 || path.search(/\.ipa$/i) !== -1;

src/lib/react-native-utils.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,13 @@ export function runHermesEmitBinaryCommand(
338338
});
339339
});
340340
}).then(() => {
341+
if (!sourcemapOutput) {
342+
// skip source map compose if source map is not enabled
343+
return;
344+
}
345+
341346
const composeSourceMapsPath = getComposeSourceMapsPath();
342-
if (sourcemapOutput && !composeSourceMapsPath) {
347+
if (!composeSourceMapsPath) {
343348
throw new Error("react-native compose-source-maps.js scripts is not found");
344349
}
345350

src/lib/validation-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as semver from "semver";
1+
import semver from "semver";
22

33
const regexpForMajor = /^\d+$/;
44
const regexpForMajorMinor = /^\d+\.\d+$/;

0 commit comments

Comments
 (0)