Nativescript-cli: Cant disable HMR

Created on 30 Jul 2019  路  4Comments  路  Source: NativeScript/nativescript-cli

Right now with the latest CLI there is no way to disable HMR.
Though HMR is still very buggy on Vue for example (with complex layouts).

using env.hmr=false wont work. But it should!

Please bring it back

question

Most helpful comment

@farfromrefug you can use --no-hmr i think

All 4 comments

@farfromrefug you can use --no-hmr i think

@danielgek wow that's it! Though env.hmr=false should do the same thing!
Thanks for the tip

@danielgek,

Thanks for handling this one.

Regarding the strange env.hmr=false behavior, it's not supported and described in the commands help (e.g. tns run --help) because currently, all env values are assumed as strings. In other words, even if we support it, it will be read as "false" which is a non-empty string and will be evaluated as true in the HMR checks :)

The only boolean env variable with default value true in some cases that we support directly through the env object is the sourceMap one and it could be disabled by passing --no-env.sourceMap. However, as I already said, the hmr is supported and documented only through the short --hmr flag and passing --no-env.hmr will not be processed.

@DimitarTachev thanks for the explanation. Now i totally get it.

Was this page helpful?
0 / 5 - 0 ratings