parent
d72f44556d
commit
cf3ff7d219
@ -13,7 +13,9 @@
|
|||||||
"app/search/search-worker.js",
|
"app/search/search-worker.js",
|
||||||
"favicon.ico",
|
"favicon.ico",
|
||||||
"pwa-manifest.json",
|
"pwa-manifest.json",
|
||||||
"google385281288605d160.html"
|
"google385281288605d160.html",
|
||||||
|
{ "glob": "custom-elements.min.js", "input": "../node_modules/@webcomponents/custom-elements", "output": "./assets/js" },
|
||||||
|
{ "glob": "native-shim.js", "input": "../node_modules/@webcomponents/custom-elements/src", "output": "./assets/js" }
|
||||||
],
|
],
|
||||||
"index": "index.html",
|
"index": "index.html",
|
||||||
"main": "main.ts",
|
"main": "main.ts",
|
||||||
|
@ -111,11 +111,24 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Custom elements should always rely on the polyfill to avoid having to include a shim that
|
//load CE polyfill
|
||||||
// handles downleveled ES2015 classes. Especially since that shim would break on IE11 which
|
//HACK: webpack's html plugin mangles the document.write calls if we don't trick it.
|
||||||
// can't even parse such code.
|
|
||||||
if (window.customElements) {
|
//load the ES5 shim for browsers with native CE support
|
||||||
window.customElements['forcePolyfill'] = true;
|
function loadCustomElementsShim(){
|
||||||
|
document.write('<scri' + 'pt src="assets/js/native-shim.js"><' + '/script>');
|
||||||
|
}
|
||||||
|
|
||||||
|
//load the full custom elements polyfill for browsers without support
|
||||||
|
function loadCustomElementsPolyfill(){
|
||||||
|
document.write('<scri' + 'pt src="assets/js/custom-elements.min.js"><' + '/script>');
|
||||||
|
}
|
||||||
|
//detect if we have native CE support
|
||||||
|
if(!window.customElements){
|
||||||
|
loadCustomElementsPolyfill();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
loadCustomElementsShim();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -30,9 +30,6 @@
|
|||||||
/** HACK: force import of environment.ts/environment.prod.ts to load env specific polyfills */
|
/** HACK: force import of environment.ts/environment.prod.ts to load env specific polyfills */
|
||||||
import './environments/environment';
|
import './environments/environment';
|
||||||
|
|
||||||
/** Add support for window.customElements */
|
|
||||||
import '@webcomponents/custom-elements/custom-elements.min';
|
|
||||||
|
|
||||||
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
|
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
|
||||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user