mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
19 lines
524 B
JavaScript
19 lines
524 B
JavaScript
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);
|
|
};
|