@@ -3,11 +3,13 @@ import { isInteractive } from "../common/helpers";
33import { cache } from "../common/decorators" ;
44import { DebugCommandErrors } from "../constants" ;
55import { ValidatePlatformCommandBase } from "./command-base" ;
6+ import { LiveSyncCommandHelper } from "../helpers/livesync-command-helper" ;
67
78export class DebugPlatformCommand extends ValidatePlatformCommandBase implements ICommand {
89 public allowedParameters : ICommandParameter [ ] = [ ] ;
910
1011 constructor ( private platform : string ,
12+ private $bundleValidatorHelper : IBundleValidatorHelper ,
1113 private $debugService : IDebugService ,
1214 protected $devicesService : Mobile . IDevicesService ,
1315 $platformService : IPlatformService ,
@@ -21,7 +23,7 @@ export class DebugPlatformCommand extends ValidatePlatformCommandBase implements
2123 private $prompter : IPrompter ,
2224 private $liveSyncCommandHelper : ILiveSyncCommandHelper ,
2325 private $androidBundleValidatorHelper : IAndroidBundleValidatorHelper ) {
24- super ( $options , $platformsData , $platformService , $projectData ) ;
26+ super ( $options , $platformsData , $platformService , $projectData ) ;
2527 }
2628
2729 public async execute ( args : string [ ] ) : Promise < void > {
@@ -36,7 +38,7 @@ export class DebugPlatformCommand extends ValidatePlatformCommandBase implements
3638
3739 const selectedDeviceForDebug = await this . getDeviceForDebug ( ) ;
3840
39- const debugData = this . $debugDataService . createDebugData ( this . $projectData , { device : selectedDeviceForDebug . deviceInfo . identifier } ) ;
41+ const debugData = this . $debugDataService . createDebugData ( this . $projectData , { device : selectedDeviceForDebug . deviceInfo . identifier } ) ;
4042
4143 if ( this . $options . start ) {
4244 await this . $liveSyncService . printDebugInformation ( await this . $debugService . debug ( debugData , debugOptions ) ) ;
@@ -118,7 +120,10 @@ export class DebugPlatformCommand extends ValidatePlatformCommandBase implements
118120 this . $errors . fail ( "--release flag is not applicable to this command" ) ;
119121 }
120122
121- const result = await super . canExecuteCommandBase ( this . platform , { validateOptions : true , notConfiguredEnvOptions : { hideCloudBuildOption : true } } ) ;
123+ const minSupportedWebpackVersion = this . $options . hmr ? LiveSyncCommandHelper . MIN_SUPPORTED_WEBPACK_VERSION_WITH_HMR : null ;
124+ this . $bundleValidatorHelper . validate ( minSupportedWebpackVersion ) ;
125+
126+ const result = await super . canExecuteCommandBase ( this . platform , { validateOptions : true , notConfiguredEnvOptions : { hideCloudBuildOption : true , hideSyncToPreviewAppOption : true } } ) ;
122127 return result ;
123128 }
124129}
@@ -209,7 +214,7 @@ export class DebugAndroidCommand implements ICommand {
209214 private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
210215 private $injector : IInjector ,
211216 private $projectData : IProjectData ) {
212- this . $projectData . initializeProjectData ( ) ;
217+ this . $projectData . initializeProjectData ( ) ;
213218 }
214219
215220 public execute ( args : string [ ] ) : Promise < void > {
0 commit comments