Skip to content

Commit 8240413

Browse files
fix: passing --hmr must always set bundle option to "webpack"
In case `--hmr` is passed, CLI should set the `bundle` option to `webpack`. This works for normal command, but in case it is command that has its own specific `--options` (commands from extensions), CLI calls `validateOptions` again and resets the value set to `--bundle`. In order to fix the behavior, set the `bundle` option to "webpack" directly in the setArgv method which is called every time.
1 parent c376458 commit 8240413

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

lib/common/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class OptionsBase {
188188
this.argv.profileDir = this.argv["profile-dir"] = this.$settingsService.getProfileDir();
189189

190190
// Default to "nativescript-dev-webpack" if only `--bundle` is passed
191-
if (this.argv.bundle !== undefined) {
191+
if (this.argv.bundle !== undefined || this.argv.hmr) {
192192
this.argv.bundle = this.argv.bundle || "webpack";
193193
}
194194

lib/options.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ export class Options extends commonOptionsLibPath.OptionsBase {
5151
if (that.justlaunch) {
5252
that.watch = false;
5353
}
54-
55-
if (that.hmr) {
56-
that.bundle = "webpack";
57-
}
5854
}
5955
}
6056
$injector.register("options", Options);

0 commit comments

Comments
 (0)