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

Commit cbba16d

Browse files
author
Dimitar Tachev
authored
Merge pull request #862 from NativeScript/tachev/merge-release-into-master
Merge release into master
2 parents 5c37a1a + 73a6174 commit cbba16d

9 files changed

+25
-20
lines changed

Diff for: android-app-components-loader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { convertSlashesInPath } = require("./projectHelpers");
22

3-
module.exports = function (source) {
3+
module.exports = function (source, map) {
44
this.cacheable();
55
const { modules } = this.query;
66
const imports = modules.map(convertSlashesInPath)
@@ -14,5 +14,5 @@ module.exports = function (source) {
1414
${source}
1515
`;
1616

17-
this.callback(null, augmentedSource);
17+
this.callback(null, augmentedSource, map);
1818
};

Diff for: apply-css-loader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(content) {
1+
module.exports = function (content, map) {
22
if (this.request.match(/\/app\.(css|scss|less|sass)$/)) {
33
return content;
44
}
@@ -14,5 +14,5 @@ module.exports = function(content) {
1414
});
1515
`;
1616

17-
return content;
17+
this.callback(null, content, map);
1818
}

Diff for: bundle-config-loader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const unitTestingConfigLoader = require("./unit-testing-config-loader");
22

3-
module.exports = function (source) {
3+
module.exports = function (source, map) {
44
this.cacheable();
55
const { angular = false, loadCss = true, unitTesting, projectRoot, appFullPath, registerModules = /(root|page)\.(xml|css|js|ts|scss)$/ } = this.query;
66

@@ -66,5 +66,5 @@ module.exports = function (source) {
6666
`;
6767
}
6868

69-
this.callback(null, source);
69+
this.callback(null, source, map);
7070
};

Diff for: css2json-loader.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const parse = require("tns-core-modules/css").parse;
22
const nl = "\n";
33

4-
module.exports = function(content) {
4+
module.exports = function (content, map) {
55
const ast = parse(content);
66
const dependencies = getImportsFrom(ast)
77
.map(mapURI)
8-
.reduce((dependencies, {uri, requireURI}) =>
8+
.reduce((dependencies, { uri, requireURI }) =>
99
dependencies + `global.registerModule(${uri}, () => require(${requireURI}));${nl}`, "");
1010

1111
const str = JSON.stringify(ast, (k, v) => k === "position" ? undefined : v);
12-
return `${dependencies}module.exports = ${str};`;
12+
this.callback(null, `${dependencies}module.exports = ${str};`, map);
1313
}
1414

1515
function getImportsFrom(ast) {

Diff for: markup-hot-loader.js

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

4-
module.exports = function (source) {
4+
module.exports = function (source, map) {
55
const typeMarkup = "markup";
66
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
77
const modulePath = convertToUnixPath(moduleRelativePath);
8-
return `${source};${reload({ type: typeMarkup, path: modulePath })}`;
8+
9+
this.callback(null, `${source};${reload({ type: typeMarkup, path: modulePath })}`, map);
910
};

Diff for: script-hot-loader.js

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

4-
module.exports = function (source) {
4+
module.exports = function (source, map) {
55
const typeScript = "script";
66
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
77
const modulePath = convertToUnixPath(moduleRelativePath);
8-
return `${source};${reload({ type: typeScript, path: modulePath })}`;
8+
this.callback(null, `${source};${reload({ type: typeScript, path: modulePath })}`, map);
99
};

Diff for: style-hot-loader.js

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

4-
module.exports = function (source) {
4+
module.exports = function (source, map) {
55
const typeStyle = "style";
66
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
77
const modulePath = convertToUnixPath(moduleRelativePath);
8-
return `${source};${reload({ type: typeStyle, path: modulePath })}`;
8+
9+
this.callback(null, `${source};${reload({ type: typeStyle, path: modulePath })}`, map);
910
};

Diff for: templates/webpack.typescript.js

+3
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ module.exports = env => {
206206
options: {
207207
configFile: "tsconfig.tns.json",
208208
allowTsInNodeModules: true,
209+
compilerOptions: {
210+
sourceMap
211+
}
209212
},
210213
}
211214
},

Diff for: xml-namespace-loader.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { parse, relative, join, basename, extname } = require("path");
22
const { promisify } = require('util');
33
const { convertSlashesInPath } = require("./projectHelpers");
44

5-
module.exports = function (source) {
5+
module.exports = function (source, map) {
66
this.value = source;
77
const { ignore } = this.query;
88
const callback = this.async();
@@ -41,14 +41,14 @@ module.exports = function (source) {
4141
this.addDependency(xml);
4242
namespaces.push({ name: `${moduleName}.xml`, path: xml });
4343
})
44-
.catch((err) => {}),
44+
.catch((err) => { }),
4545

4646
resolvePromise(this.context, `${noExtFilename}.css`)
4747
.then((css) => {
4848
this.addDependency(css);
4949
namespaces.push({ name: `${moduleName}.css`, path: css });
5050
})
51-
.catch((err) => {})
51+
.catch((err) => { })
5252
]);
5353
};
5454

@@ -75,7 +75,7 @@ module.exports = function (source) {
7575
namespaces.push({ name: `${moduleName}.css`, path: css });
7676
this.addDependency(css);
7777
})
78-
.catch(() => {})
78+
.catch(() => { })
7979
]);
8080

8181
});
@@ -102,7 +102,7 @@ module.exports = function (source) {
102102

103103
const wrapped = `${moduleRegisters}\nmodule.exports = ${json}`;
104104

105-
callback(null, wrapped);
105+
callback(null, wrapped, map);
106106
}).catch((err) => {
107107
callback(err);
108108
})

0 commit comments

Comments
 (0)