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

Merge release into master #862

Merged
merged 7 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android-app-components-loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { convertSlashesInPath } = require("./projectHelpers");

module.exports = function (source) {
module.exports = function (source, map) {
this.cacheable();
const { modules } = this.query;
const imports = modules.map(convertSlashesInPath)
Expand All @@ -14,5 +14,5 @@ module.exports = function (source) {
${source}
`;

this.callback(null, augmentedSource);
this.callback(null, augmentedSource, map);
};
4 changes: 2 additions & 2 deletions apply-css-loader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function(content) {
module.exports = function (content, map) {
if (this.request.match(/\/app\.(css|scss|less|sass)$/)) {
return content;
}
Expand All @@ -14,5 +14,5 @@ module.exports = function(content) {
});
`;

return content;
this.callback(null, content, map);
}
4 changes: 2 additions & 2 deletions bundle-config-loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const unitTestingConfigLoader = require("./unit-testing-config-loader");

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

Expand Down Expand Up @@ -66,5 +66,5 @@ module.exports = function (source) {
`;
}

this.callback(null, source);
this.callback(null, source, map);
};
6 changes: 3 additions & 3 deletions css2json-loader.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const parse = require("tns-core-modules/css").parse;
const nl = "\n";

module.exports = function(content) {
module.exports = function (content, map) {
const ast = parse(content);
const dependencies = getImportsFrom(ast)
.map(mapURI)
.reduce((dependencies, {uri, requireURI}) =>
.reduce((dependencies, { uri, requireURI }) =>
dependencies + `global.registerModule(${uri}, () => require(${requireURI}));${nl}`, "");

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

function getImportsFrom(ast) {
Expand Down
5 changes: 3 additions & 2 deletions markup-hot-loader.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const { reload } = require("./hot-loader-helper");
const { convertToUnixPath } = require("./lib/utils");

module.exports = function (source) {
module.exports = function (source, map) {
const typeMarkup = "markup";
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
const modulePath = convertToUnixPath(moduleRelativePath);
return `${source};${reload({ type: typeMarkup, path: modulePath })}`;

this.callback(null, `${source};${reload({ type: typeMarkup, path: modulePath })}`, map);
};
4 changes: 2 additions & 2 deletions script-hot-loader.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { reload } = require("./hot-loader-helper");
const { convertToUnixPath } = require("./lib/utils");

module.exports = function (source) {
module.exports = function (source, map) {
const typeScript = "script";
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
const modulePath = convertToUnixPath(moduleRelativePath);
return `${source};${reload({ type: typeScript, path: modulePath })}`;
this.callback(null, `${source};${reload({ type: typeScript, path: modulePath })}`, map);
};
5 changes: 3 additions & 2 deletions style-hot-loader.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const { reload } = require("./hot-loader-helper");
const { convertToUnixPath } = require("./lib/utils");

module.exports = function (source) {
module.exports = function (source, map) {
const typeStyle = "style";
const moduleRelativePath = this.resourcePath.replace(this.rootContext, ".");
const modulePath = convertToUnixPath(moduleRelativePath);
return `${source};${reload({ type: typeStyle, path: modulePath })}`;

this.callback(null, `${source};${reload({ type: typeStyle, path: modulePath })}`, map);
};
3 changes: 3 additions & 0 deletions templates/webpack.typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ module.exports = env => {
options: {
configFile: "tsconfig.tns.json",
allowTsInNodeModules: true,
compilerOptions: {
sourceMap
}
},
}
},
Expand Down
10 changes: 5 additions & 5 deletions xml-namespace-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { parse, relative, join, basename, extname } = require("path");
const { promisify } = require('util');
const { convertSlashesInPath } = require("./projectHelpers");

module.exports = function (source) {
module.exports = function (source, map) {
this.value = source;
const { ignore } = this.query;
const callback = this.async();
Expand Down Expand Up @@ -41,14 +41,14 @@ module.exports = function (source) {
this.addDependency(xml);
namespaces.push({ name: `${moduleName}.xml`, path: xml });
})
.catch((err) => {}),
.catch((err) => { }),

resolvePromise(this.context, `${noExtFilename}.css`)
.then((css) => {
this.addDependency(css);
namespaces.push({ name: `${moduleName}.css`, path: css });
})
.catch((err) => {})
.catch((err) => { })
]);
};

Expand All @@ -75,7 +75,7 @@ module.exports = function (source) {
namespaces.push({ name: `${moduleName}.css`, path: css });
this.addDependency(css);
})
.catch(() => {})
.catch(() => { })
]);

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

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

callback(null, wrapped);
callback(null, wrapped, map);
}).catch((err) => {
callback(err);
})
Expand Down