@@ -11,8 +11,10 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
11
11
constructor (
12
12
private $childProcess : IChildProcess ,
13
13
public $hooksService : IHooksService ,
14
+ public $hostInfo : IHostInfo ,
14
15
private $logger : ILogger ,
15
- private $pluginsService : IPluginsService
16
+ private $pluginsService : IPluginsService ,
17
+ private $mobileHelper : Mobile . IMobileHelper
16
18
) { super ( ) ; }
17
19
18
20
public async compileWithWatch ( platformData : IPlatformData , projectData : IProjectData , prepareData : IPrepareData ) : Promise < any > {
@@ -103,7 +105,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
103
105
@hook ( 'prepareJSApp' )
104
106
private async startWebpackProcess ( platformData : IPlatformData , projectData : IProjectData , prepareData : IPrepareData ) : Promise < child_process . ChildProcess > {
105
107
const envData = this . buildEnvData ( platformData . platformNameLowerCase , projectData , prepareData ) ;
106
- const envParams = this . buildEnvCommandLineParams ( envData , platformData ) ;
108
+ const envParams = this . buildEnvCommandLineParams ( envData , platformData , prepareData ) ;
107
109
108
110
await this . $pluginsService . ensureAllDependenciesAreInstalled ( projectData ) ;
109
111
@@ -156,13 +158,15 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
156
158
return envData ;
157
159
}
158
160
159
- private buildEnvCommandLineParams ( envData : any , platformData : IPlatformData ) {
161
+ private buildEnvCommandLineParams ( envData : any , platformData : IPlatformData , prepareData : IPrepareData ) {
160
162
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
+ }
166
170
167
171
const args : any [ ] = [ ] ;
168
172
envFlagNames . map ( item => {
0 commit comments