feat: split globals to support smaller worker chuncks

This commit is contained in:
vakrilov
2019-07-11 12:12:45 +03:00
parent 92238a902d
commit 0ee0b67249
15 changed files with 157 additions and 156 deletions

View File

@@ -0,0 +1,25 @@
// Required by TypeScript compiler
import "../ts-helpers";
import "../register-module-helpers";
// This method iterates all the keys in the source exports object and copies them to the destination exports one.
// Note: the method will not check for naming collisions and will override any already existing entries in the destination exports.
global.moduleMerge = function (sourceExports: any, destExports: any) {
for (let key in sourceExports) {
destExports[key] = sourceExports[key];
}
};
global.zonedCallback = function (callback: Function): Function {
if ((<any>global).zone) {
// Zone v0.5.* style callback wrapping
return (<any>global).zone.bind(callback);
}
if ((<any>global).Zone) {
// Zone v0.6.* style callback wrapping
return (<any>global).Zone.current.wrap(callback);
} else {
return callback;
}
};

View File

@@ -0,0 +1,5 @@
{
"name" : "core",
"main" : "globals-core",
"nativescript": {}
}