Skip to content

Commit a6d5eb5

Browse files
committed
fix: fix livesync when --no-hmr option is provided and changes are reverted to the initial state of application
Livesync doesn't work when `tns run ios --no-hmr` command is executed, same changes are synced and the application is reverted to its initial state. On first webpack compilation CLI stores the initial hash of the compilation but the stored hash is updated only in `hmr` mode. On the other side, CLI has a logic to return when the stored hash is the same as the current hash. So, when the changes are reverted to the initial state of the application, the current hash is the same as the first reported hash. This way, CLI doesn't execute any livesync logic after the reported changes from webpack process. Rel to: #5132
1 parent 954189b commit a6d5eb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/services/webpack/webpack-compiler-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
4242
if (message.emittedFiles) {
4343
if (isFirstWebpackWatchCompilation) {
4444
isFirstWebpackWatchCompilation = false;
45-
this.expectedHashes[platformData.platformNameLowerCase] = message.hash;
45+
this.expectedHashes[platformData.platformNameLowerCase] = prepareData.hmr ? message.hash : "";
4646
return;
4747
}
4848

0 commit comments

Comments
 (0)