fix: passing --hmr must always set bundle option to "webpack" #3936
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In case
--hmr
is passed, CLI should set thebundle
option towebpack
. This works for normal command, but in case it is command that has its own specific--options
(commands from extensions), CLI callsvalidateOptions
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.refactor: remove OptionsBase and move logic to Options
As we do not have submodule anymore, remove the
OptionsBase
class and move the implementation toOptions
class.Remove the
lib/common/options.ts
file and theICommonOptions
interface.Replace the usage of
ICommonOptions
withIOptions
.Fix the unit tests of
lib/common/test/unit-tests/common-options
to useOptions
instead ofOptionsBase
and apply some changes in the passed options in the tests, so they can be valid now. Move the tests totest/options.ts
PR Checklist
What is the current behavior?
tns cloud run android --hmr --accountId 1
does not use webpack build.What is the new behavior?
tns cloud run android --hmr --accountId 1
uses webpack build and HMR is applied.