Skip to content

Commit

Permalink
fix: skip compose sourcemap for hermes if the sourcemap option is not…
Browse files Browse the repository at this point in the history
… enabled
  • Loading branch information
rocwind committed Aug 18, 2020
1 parent a51939e commit 0555005
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/lib/cordova-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as xml2js from "xml2js";
import * as fs from "fs";
import * as path from "path";
import xml2js from "xml2js";
import fs from "fs";
import path from "path";

export function getCordovaProjectAppVersion(projectRoot?: string): Promise<string> {
return new Promise<string>((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/file-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from "fs";
import fs from "fs";

export function isBinaryOrZip(path: string): boolean {
return path.search(/\.zip$/i) !== -1 || path.search(/\.apk$/i) !== -1 || path.search(/\.ipa$/i) !== -1;
Expand Down
7 changes: 6 additions & 1 deletion src/lib/react-native-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,13 @@ export function runHermesEmitBinaryCommand(
});
});
}).then(() => {
if (!sourcemapOutput) {
// skip source map compose if source map is not enabled
return;
}

const composeSourceMapsPath = getComposeSourceMapsPath();
if (sourcemapOutput && !composeSourceMapsPath) {
if (!composeSourceMapsPath) {
throw new Error("react-native compose-source-maps.js scripts is not found");
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/validation-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as semver from "semver";
import semver from "semver";

const regexpForMajor = /^\d+$/;
const regexpForMajorMinor = /^\d+\.\d+$/;
Expand Down

0 comments on commit 0555005

Please sign in to comment.