MOBILE-3720 env: Add missing polyfills
parent
25e37eb5fd
commit
0ce486ce9d
|
@ -139,6 +139,12 @@
|
||||||
"uri-js": "^4.2.2"
|
"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": {
|
"open": {
|
||||||
"version": "7.0.4",
|
"version": "7.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/open/-/open-7.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/open/-/open-7.0.4.tgz",
|
||||||
|
@ -5873,9 +5879,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"caniuse-lite": {
|
"caniuse-lite": {
|
||||||
"version": "1.0.30001144",
|
"version": "1.0.30001197",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001144.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001197.tgz",
|
||||||
"integrity": "sha512-4GQTEWNMnVZVOFG3BK0xvGeaDAtiPAbG2N8yuMXuXzx/c2Vd4XoMPO8+E918zeXn5IF0FRVtGShBfkfQea2wHQ==",
|
"integrity": "sha512-8aE+sqBqtXz4G8g35Eg/XEaFr2N7rd/VQ6eABGBmNtcB8cN6qNJhMi6oSFy4UWWZgqgL3filHT8Nha4meu3tsw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"canonical-path": {
|
"canonical-path": {
|
||||||
|
@ -7890,10 +7896,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"core-js": {
|
"core-js": {
|
||||||
"version": "3.6.4",
|
"version": "3.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.9.1.tgz",
|
||||||
"integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==",
|
"integrity": "sha512-gSjRvzkxQc1zjM/5paAmL4idJBFzuJoo+jDjF1tStYFMV2ERfD02HhahhCGXUyHxQRG4yFKVSdO6g62eoRMcDg=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"core-js-compat": {
|
"core-js-compat": {
|
||||||
"version": "3.6.5",
|
"version": "3.6.5",
|
||||||
|
|
|
@ -107,6 +107,7 @@
|
||||||
"cordova-sqlite-storage": "^4.0.0",
|
"cordova-sqlite-storage": "^4.0.0",
|
||||||
"cordova-support-google-services": "^1.2.1",
|
"cordova-support-google-services": "^1.2.1",
|
||||||
"cordova.plugins.diagnostic": "^5.0.2",
|
"cordova.plugins.diagnostic": "^5.0.2",
|
||||||
|
"core-js": "^3.9.1",
|
||||||
"es6-promise-plugin": "^4.2.2",
|
"es6-promise-plugin": "^4.2.2",
|
||||||
"jszip": "^3.5.0",
|
"jszip": "^3.5.0",
|
||||||
"moment": "^2.29.0",
|
"moment": "^2.29.0",
|
||||||
|
|
|
@ -17,3 +17,42 @@ window.__Zone_disable_customElements = true;
|
||||||
|
|
||||||
// Zone JS is required by default for Angular itself.
|
// Zone JS is required by default for Angular itself.
|
||||||
import 'zone.js/dist/zone';
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue