Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Commit b4174d9

Browse files
committed
docs: improving HMR by default article
1 parent b055876 commit b4174d9

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

docs/start/cli-basics.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Now that you have a full setup in place for developing your apps let’s look at
241241

242242
### Using RUN with HMR
243243

244-
The developer experience significantly improves by using the [HMR (Hot Module Replacement)](/performance-optimizations/bundling-with-webpack#hot-module-replacement) feature introduced in NativeScript 5. The option requires Webpack (enabled by default in all NativeScript 5.x.x templates) and behind the scene is creating Webpack bundle with the enhancement of Hot Module Replacement developer experience.
244+
The developer experience significantly improves by using the [HMR (Hot Module Replacement)](/performance-optimizations/bundling-with-webpack#hot-module-replacement) feature introduced in NativeScript 5. The option requires **nativescript-dev-webpack** plugin (enabled by default in all NativeScript 5.x.x templates) and behind the scene creates Webpack bundle with the enhancement of Hot Module Replacement developer experience.
245245

246246
To enable HMR during your development pass the `--hmr` flag (you can emit the `--bundle` which is automatically triggered).
247247

@@ -274,13 +274,24 @@ tns run
274274

275275
> **Note:** There are conceptual differences when the `useLegacyWorkflow` is used in **debug** build versus when used in **release** builds. When the flag is enabled against a debug build, the extended HMR experience is enabled. However, in cases where the `--release` flag is passed (release build) then only the `--bundle` is executed in the background (No HMR). The reason for this is to avoid bringing additional HMR logic and files into production. For details about the differences between Webpack livesync and HMR refer to [the comparative table](/performance-optimizations/bundling-with-webpack#hot-module-replacement).
276276
277-
In case, when you have enabled the default HMR via the `useLegacyWorkflow` option, but you need to test without using HMR you can pass the `--no-hmr` flag to disable the feature for the current build.
277+
#### Enhancement flags for useLegacyWorkflow
278+
279+
The flags `--no-hmr` and `--no-bundle` can be used once the `useLegacyWorkflow` option is set to `false`.
280+
281+
In case, when you have enabled the default HMR via the `useLegacyWorkflow` option, but you need to test without using HMR you can pass the `--no-hmr` flag to disable the feature for the current build.
278282

279283
For example:
280284
```Shell
281285
tns run --no-hmr
282286
```
283-
Using `--no-hmr` will effectively provide the default livesync experience.
287+
Using `--no-hmr` will effectively provide the default livesync experience with Webpack bundle.
288+
289+
In case, when you have enabled the default HMR via the `useLegacyWorkflow` option, but you want to disable both HMR and Webpack bundling, you can pass `--no-bundle` flag.
290+
291+
For example:
292+
```Shell
293+
tns run --no-bundle
294+
```
284295

285296
### Next steps
286297

0 commit comments

Comments
 (0)