mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
chore(core): monorepo, esm targeting, improved management (#8707)
This commit is contained in:
18
packages/webpack/helpers/android-app-components-loader.js
Normal file
18
packages/webpack/helpers/android-app-components-loader.js
Normal 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);
|
||||
};
|
Reference in New Issue
Block a user