From 516fd310d4b7953c9448ca34bfb429a55b99c50d Mon Sep 17 00:00:00 2001 From: fatme Date: Tue, 29 Oct 2019 09:40:36 +0200 Subject: [PATCH] fix: handle correctly the situation when the compilation hash is the same as the previous one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently CLI considers the hash that is the same as the previous as invalid and this way the application is restarted on device. As that hash is already handled, we should consider it as a valid hash. Steps to reproduce : ``` `tns create ts_proj` - choose ts tabs project npm i tns-core-modules@rc --save --save-exact npm i nativescript-dev-webpack@rc --save-dev --save-exact node_modules/.bin/update-ns-webpack --deps –configs tns run android Change something in app.android.scss - the change is applied, no restart Change something in app.ios.scss - application restarts ``` --- lib/services/webpack/webpack-compiler-service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 4f0dd015da..297e306bef 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -46,6 +46,11 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp return; } + // the hash of the compilation is the same as the previous one + if (this.expectedHashes[platformData.platformNameLowerCase] === message.hash) { + return; + } + let result; if (prepareData.hmr) {