Skip to content

Commit 687dde2

Browse files
Merge pull request #5250 from NativeScript/vladimirov/fix-livesync-externals
fix: external files are not livesynced
2 parents 5550613 + a9e1cf0 commit 687dde2

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
NativeScript CLI Changelog
22
================
33

4+
6.4.1 (2020, February 19)
5+
===
6+
7+
### Fixed
8+
9+
* [Fixed #5251](https://github.com/NativeScript/nativescript-cli/issues/5251): External files are not livesynced
10+
11+
412
6.4.0 (2020, February 11)
513
===
614

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,8 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
4949
return;
5050
}
5151

52-
// the hash of the compilation is the same as the previous one
53-
if (this.expectedHashes[platformData.platformNameLowerCase] === message.hash) {
54-
return;
55-
}
56-
52+
// Persist the previousHash value before calling `this.getUpdatedEmittedFiles` as it will modify the expectedHashes object with the current hash
53+
const previousHash = this.expectedHashes[platformData.platformNameLowerCase];
5754
let result;
5855

5956
if (prepareData.hmr) {
@@ -78,6 +75,12 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
7875
};
7976

8077
this.$logger.trace("Generated data from webpack message:", data);
78+
79+
// the hash of the compilation is the same as the previous one and there are only hot updates produced
80+
if (data.hasOnlyHotUpdateFiles && previousHash === message.hash) {
81+
return;
82+
}
83+
8184
if (data.files.length) {
8285
this.emit(WEBPACK_COMPILATION_COMPLETE, data);
8386
}

npm-shrinkwrap.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nativescript",
33
"preferGlobal": true,
4-
"version": "6.4.0",
4+
"version": "6.4.1",
55
"author": "Telerik <[email protected]>",
66
"description": "Command-line interface for building NativeScript projects",
77
"bin": {

0 commit comments

Comments
 (0)