@@ -11,8 +11,10 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
1111 constructor (
1212 private $childProcess : IChildProcess ,
1313 public $hooksService : IHooksService ,
14+ public $hostInfo : IHostInfo ,
1415 private $logger : ILogger ,
15- private $pluginsService : IPluginsService
16+ private $pluginsService : IPluginsService ,
17+ private $mobileHelper : Mobile . IMobileHelper
1618 ) { super ( ) ; }
1719
1820 public async compileWithWatch ( platformData : IPlatformData , projectData : IProjectData , prepareData : IPrepareData ) : Promise < any > {
@@ -103,7 +105,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
103105 @hook ( 'prepareJSApp' )
104106 private async startWebpackProcess ( platformData : IPlatformData , projectData : IProjectData , prepareData : IPrepareData ) : Promise < child_process . ChildProcess > {
105107 const envData = this . buildEnvData ( platformData . platformNameLowerCase , projectData , prepareData ) ;
106- const envParams = this . buildEnvCommandLineParams ( envData , platformData ) ;
108+ const envParams = this . buildEnvCommandLineParams ( envData , platformData , prepareData ) ;
107109
108110 await this . $pluginsService . ensureAllDependenciesAreInstalled ( projectData ) ;
109111
@@ -156,13 +158,15 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
156158 return envData ;
157159 }
158160
159- private buildEnvCommandLineParams ( envData : any , platformData : IPlatformData ) {
161+ private buildEnvCommandLineParams ( envData : any , platformData : IPlatformData , prepareData : IPrepareData ) {
160162 const envFlagNames = Object . keys ( envData ) ;
161- // const snapshotEnvIndex = envFlagNames.indexOf("snapshot");
162- // if (snapshotEnvIndex > -1 && !utils.shouldSnapshot(config)) {
163- // logSnapshotWarningMessage($logger);
164- // envFlagNames.splice(snapshotEnvIndex, 1);
165- // }
163+ const shouldSnapshot = prepareData . release && ! this . $hostInfo . isWindows && this . $mobileHelper . isAndroidPlatform ( platformData . normalizedPlatformName ) ;
164+ if ( envData && envData . snapshot && ! shouldSnapshot ) {
165+ this . $logger . warn ( "Stripping the snapshot flag. " +
166+ "Bear in mind that snapshot is only available in release builds and " +
167+ "is NOT available on Windows systems." ) ;
168+ envFlagNames . splice ( envFlagNames . indexOf ( "snapshot" ) , 1 ) ;
169+ }
166170
167171 const args : any [ ] = [ ] ;
168172 envFlagNames . map ( item => {
0 commit comments