MOBILE-3720 env: Add missing polyfills

main
Noel De Martin 2021-03-09 12:53:51 +01:00
parent 25e37eb5fd
commit 0ce486ce9d
3 changed files with 52 additions and 7 deletions

19
package-lock.json generated
View File

@ -139,6 +139,12 @@
"uri-js": "^4.2.2"
}
},
"core-js": {
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz",
"integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==",
"dev": true
},
"open": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/open/-/open-7.0.4.tgz",
@ -5873,9 +5879,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001144",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001144.tgz",
"integrity": "sha512-4GQTEWNMnVZVOFG3BK0xvGeaDAtiPAbG2N8yuMXuXzx/c2Vd4XoMPO8+E918zeXn5IF0FRVtGShBfkfQea2wHQ==",
"version": "1.0.30001197",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001197.tgz",
"integrity": "sha512-8aE+sqBqtXz4G8g35Eg/XEaFr2N7rd/VQ6eABGBmNtcB8cN6qNJhMi6oSFy4UWWZgqgL3filHT8Nha4meu3tsw==",
"dev": true
},
"canonical-path": {
@ -7890,10 +7896,9 @@
}
},
"core-js": {
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz",
"integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==",
"dev": true
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.9.1.tgz",
"integrity": "sha512-gSjRvzkxQc1zjM/5paAmL4idJBFzuJoo+jDjF1tStYFMV2ERfD02HhahhCGXUyHxQRG4yFKVSdO6g62eoRMcDg=="
},
"core-js-compat": {
"version": "3.6.5",

View File

@ -107,6 +107,7 @@
"cordova-sqlite-storage": "^4.0.0",
"cordova-support-google-services": "^1.2.1",
"cordova.plugins.diagnostic": "^5.0.2",
"core-js": "^3.9.1",
"es6-promise-plugin": "^4.2.2",
"jszip": "^3.5.0",
"moment": "^2.29.0",

View File

@ -17,3 +17,42 @@ window.__Zone_disable_customElements = true;
// Zone JS is required by default for Angular itself.
import 'zone.js/dist/zone';
// Platform polyfills
import 'core-js/es/array/includes';
import 'core-js/es/promise/finally';
import 'core-js/es/string/match-all';
import 'core-js/es/string/trim-right';
polyfillEventComposedPath();
/**
* Polyfill Event.composedPath() if necessary.
*
* @see https://github.com/ionic-team/stencil/issues/2681
*/
function polyfillEventComposedPath() {
const event = new Event('') as { path?: NodeList };
if (!('path' in event && event.path instanceof NodeList)) {
return;
}
Event.prototype.composedPath = function () {
if (this._composedPath) {
return this._composedPath;
}
let node = this.target;
for (this._composedPath = []; node.parentNode !== null;) {
this._composedPath.push(node);
node = node.parentNode;
}
this._composedPath.push(document, window);
return this._composedPath;
};
}