Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit cfcec23

Browse files
authored
Merge pull request #813 from NativeScript/vchimev/merge-release-into-master
chore: merge release into master
2 parents 3bdad78 + e55e12b commit cfcec23

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

Diff for: lib/utils.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
const os = require("os");
2-
const path = require("path");
32

43
const {
54
getAppPathFromProjectData,
65
getAppResourcesPathFromProjectData,
7-
getProjectDir,
86
isAndroid,
97
} = require("../projectHelpers");
108

@@ -92,12 +90,17 @@ function removeListener(eventEmitter, name) {
9290
}
9391
}
9492

93+
function convertToUnixPath(relativePath) {
94+
return relativePath.replace(/\\/g, "/");
95+
}
96+
9597
module.exports = {
9698
buildEnvData,
9799
debuggingEnabled,
98100
shouldSnapshot,
99101
getUpdatedEmittedFiles,
100102
parseHotUpdateChunkName,
101103
addListener,
102-
removeListener
104+
removeListener,
105+
convertToUnixPath
103106
};

Diff for: markup-hot-loader.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const { reload } = require("./hot-loader-helper");
2+
const { convertToUnixPath } = require("./lib/utils");
23

34
module.exports = function (source) {
45
const typeMarkup = "markup";
5-
const modulePath = this.resourcePath.replace(this.rootContext, ".");
6+
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
7+
const modulePath = convertToUnixPath(moduleRelativePath);
68
return `${source};${reload({ type: typeMarkup, path: modulePath })}`;
79
};

Diff for: script-hot-loader.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const { reload } = require("./hot-loader-helper");
2+
const { convertToUnixPath } = require("./lib/utils");
23

34
module.exports = function (source) {
45
const typeScript = "script";
5-
const modulePath = this.resourcePath.replace(this.rootContext, ".");
6+
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
7+
const modulePath = convertToUnixPath(moduleRelativePath);
68
return `${source};${reload({ type: typeScript, path: modulePath })}`;
79
};

Diff for: style-hot-loader.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const { reload } = require("./hot-loader-helper");
2+
const { convertToUnixPath } = require("./lib/utils");
23

34
module.exports = function (source) {
45
const typeStyle = "style";
5-
const modulePath = this.resourcePath.replace(this.rootContext, ".");
6+
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
7+
const modulePath = convertToUnixPath(moduleRelativePath);
68
return `${source};${reload({ type: typeStyle, path: modulePath })}`;
79
};

0 commit comments

Comments
 (0)