Skip to content

Commit 1eb3496

Browse files
committed
chore: fix PR comments
1 parent b010e00 commit 1eb3496

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/services/webpack/webpack-compiler-service.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as path from "path";
22
import * as child_process from "child_process";
3-
import * as os from "os";
43
import { EventEmitter } from "events";
54
import { performanceLog } from "../../common/decorators";
65
import { hook } from "../../common/helpers";
@@ -12,6 +11,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
1211
constructor(
1312
private $childProcess: IChildProcess,
1413
public $hooksService: IHooksService,
14+
public $hostInfo: IHostInfo,
1515
private $logger: ILogger,
1616
private $pluginsService: IPluginsService,
1717
private $mobileHelper: Mobile.IMobileHelper
@@ -160,13 +160,12 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
160160

161161
private buildEnvCommandLineParams(envData: any, platformData: IPlatformData, prepareData: IPrepareData) {
162162
const envFlagNames = Object.keys(envData);
163-
const snapshotEnvIndex = envFlagNames.indexOf("snapshot");
164-
const shouldSnapshot = prepareData.release && os.type() !== "Windows_NT" && this.$mobileHelper.isAndroidPlatform(platformData.normalizedPlatformName);
165-
if (snapshotEnvIndex > -1 && !shouldSnapshot) {
163+
const shouldSnapshot = prepareData.release && !this.$hostInfo.isWindows && this.$mobileHelper.isAndroidPlatform(platformData.normalizedPlatformName);
164+
if (envData && envData.snapshot && !shouldSnapshot) {
166165
this.$logger.warn("Stripping the snapshot flag. " +
167166
"Bear in mind that snapshot is only available in release builds and " +
168167
"is NOT available on Windows systems.");
169-
envFlagNames.splice(snapshotEnvIndex, 1);
168+
envFlagNames.splice(envFlagNames.indexOf("snapshot"), 1);
170169
}
171170

172171
const args: any[] = [];

0 commit comments

Comments
 (0)