Fix the ES5 adapter for custom panel (#3182)

* Fix the ES5 adapter for custom panel

* Update custom-panel.ts

* Update custom-panel.ts

* Update custom-panel.ts
This commit is contained in:
Paulus Schoutsen 2019-05-09 15:36:16 -07:00 committed by GitHub
parent 968eae7727
commit d77ae840d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,9 @@ let es5Loaded: Promise<unknown> | undefined;
window.loadES5Adapter = () => {
if (!es5Loaded) {
es5Loaded = Promise.all([
loadJS(`${__STATIC_PATH__}custom-elements-es5-adapter.js`).catch(),
loadJS(
`${__STATIC_PATH__}/polyfills/custom-elements-es5-adapter.js`
).catch(),
import(/* webpackChunkName: "compat" */ "./compatibility"),
]);
}
@ -47,7 +49,9 @@ function initialize(panel: CustomPanelInfo, properties: {}) {
let start: Promise<unknown> = Promise.resolve();
if (!webComponentsSupported) {
start = start.then(() => loadJS("/static/webcomponents-bundle.js"));
start = start.then(() =>
loadJS(`${__STATIC_PATH__}/polyfills/webcomponents-bundle.js`)
);
}
if (__BUILD__ === "es5") {