@@ -6,7 +6,6 @@ export class Options {
6
6
private static NONDASHED_OPTION_REGEX = / ( .+ ?) [ - ] ( [ a - z A - Z ] ) ( .* ) / ;
7
7
8
8
private optionsWhiteList = [ "ui" , "recursive" , "reporter" , "require" , "timeout" , "_" , "$0" ] ; // These options shouldn't be validated
9
- private yargsArgv : yargs . Argv ;
10
9
private globalOptions : IDictionary < IDashedOption > = {
11
10
log : { type : OptionType . String , hasSensitiveValue : false } ,
12
11
verbose : { type : OptionType . Boolean , alias : "v" , hasSensitiveValue : false } ,
@@ -19,6 +18,7 @@ export class Options {
19
18
_ : { type : OptionType . String , hasSensitiveValue : false }
20
19
} ;
21
20
21
+ private initialArgv : yargs . Arguments ;
22
22
public argv : yargs . Arguments ;
23
23
public options : IDictionary < IDashedOption > ;
24
24
@@ -31,7 +31,7 @@ export class Options {
31
31
this . argv . bundle = "webpack" ;
32
32
33
33
// Check if the user has explicitly provide --hmr and --release options from command line
34
- if ( this . yargsArgv . argv . release && this . yargsArgv . argv . hmr ) {
34
+ if ( this . initialArgv . release && this . initialArgv . hmr ) {
35
35
this . $errors . failWithoutHelp ( "The options --release and --hmr cannot be used simultaneously." ) ;
36
36
}
37
37
@@ -250,8 +250,9 @@ export class Options {
250
250
opts [ this . getDashedOptionName ( key ) ] = value ;
251
251
} ) ;
252
252
253
- this . yargsArgv = yargs ( process . argv . slice ( 2 ) ) ;
254
- this . argv = this . yargsArgv . options ( < any > opts ) . argv ;
253
+ const parsed = yargs ( process . argv . slice ( 2 ) ) ;
254
+ this . initialArgv = parsed . argv ;
255
+ this . argv = parsed . options ( < any > opts ) . argv ;
255
256
256
257
// For backwards compatibility
257
258
// Previously profileDir had a default option and calling `this.$options.profileDir` always returned valid result.
0 commit comments