11import * as path from "path" ;
22import * as child_process from "child_process" ;
3- import * as os from "os" ;
43import { EventEmitter } from "events" ;
54import { performanceLog } from "../../common/decorators" ;
65import { 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