chore(core): monorepo, esm targeting, improved management (#8707)

This commit is contained in:
Nathan Walker
2020-08-25 20:00:59 -07:00
committed by GitHub
parent 6f15334934
commit 020ad4da37
4271 changed files with 148599 additions and 149734 deletions

View File

@ -0,0 +1,18 @@
const { convertSlashesInPath } = require("./projectHelpers");
module.exports = function (source, map) {
this.cacheable();
const { modules } = this.query;
const imports = modules.map(convertSlashesInPath)
.map(m => `require("${m}");`).join("\n");
const augmentedSource = `
const isAndroid = require("@nativescript/core").isAndroid;
if (isAndroid && !global["__snapshot"]) {
${imports}
}
${source}
`;
this.callback(null, augmentedSource, map);
};