Skip to content

Instantly share code, notes, and snippets.

@glebmachine
Created December 25, 2018 14:08
Show Gist options
  • Save glebmachine/51e061ff1428934d44720c1b0ca3e0d4 to your computer and use it in GitHub Desktop.
Save glebmachine/51e061ff1428934d44720c1b0ca3e0d4 to your computer and use it in GitHub Desktop.
Пример полифилов
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/array';
import 'core-js/es6/date';
import 'core-js/es6/function';
import 'core-js/es6/map';
import 'core-js/es6/math';
import 'core-js/es6/number';
import 'core-js/es6/object';
import 'core-js/es6/parse-float';
import 'core-js/es6/parse-int';
import 'core-js/es6/regexp';
import 'core-js/es6/set';
import 'core-js/es6/string';
import 'core-js/es6/symbol';
import 'core-js/es6/weak-map';
import 'core-js/es7/array';
import 'core-js/es7/object';
import 'core-js/es6/promise';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
import 'classlist.js'; // Run `npm install --save classlist.js`.
/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';
/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
import 'core-js/es7/reflect';
import 'element-closest';
import 'scrolling-element';
import 'url-polyfill';
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
**/
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*/
// (window as any).__Zone_enable_cross_context_check = true;
const global = window;
// disable on properties
const targets = [window, Document, HTMLBodyElement, HTMLElement];
const __Zone_ignore_on_properties = [];
targets.forEach(target => {
__Zone_ignore_on_properties.push({
target: target,
ignoreProperties: ['scroll', 'wheel', 'mousemove']
});
});
global['__zone_symbol__BLACK_LISTED_EVENTS'] = ['scroll', 'wheel', 'mousemove'];
global['__Zone_disable_requestAnimationFrame'] = true;
global['__Zone_disable_PromiseRejectionEvent'] = true;
/***************************************************************************************************
* APPLICATION IMPORTS
*/
// Для старперов типа гсапа, идиоты блять
try {
if (window && !window['global']) {
window['global'] = window;
}
} catch (e) {}
// Ребята которые делаю cli, чет не учли опять pixijs не стартует
(window as any).process = {
env: { DEBUG: undefined },
};
// // Полифил для Chrome < 43 (не поддерживает CSS свойство animate)
if (document.body.style['animation'] === undefined) {
CSSStyleDeclaration.prototype['animation'] = '';
CSSStyleDeclaration.prototype['animation-name'] = '';
CSSStyleDeclaration.prototype['animation-duration'] = '';
CSSStyleDeclaration.prototype['animation-timing-function'] = '';
CSSStyleDeclaration.prototype['animation-delay'] = '';
CSSStyleDeclaration.prototype['animation-iteration-count'] = '';
CSSStyleDeclaration.prototype['animation-direction'] = '';
CSSStyleDeclaration.prototype['animation-fill-mode'] = '';
CSSStyleDeclaration.prototype['animation-play-state'] = '';
CSSStyleDeclaration.prototype['animation'] = '';
CSSStyleDeclaration.prototype['animationName'] = '';
CSSStyleDeclaration.prototype['animationDuration'] = '';
CSSStyleDeclaration.prototype['animationTimingFunction'] = '';
CSSStyleDeclaration.prototype['animationDelay'] = '';
CSSStyleDeclaration.prototype['animationIterationCount'] = '';
CSSStyleDeclaration.prototype['animationDirection'] = '';
CSSStyleDeclaration.prototype['animationFillMode'] = '';
CSSStyleDeclaration.prototype['animationPlayState'] = '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment