astro/packages/integrations/lit/server-shim.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
416 B
JavaScript
Raw Normal View History

import { installWindowOnGlobal } from '@lit-labs/ssr/lib/dom-shim.js';
installWindowOnGlobal();
window.global = window;
document.getElementsByTagName = () => [];
// See https://github.com/lit/lit/issues/2393
document.currentScript = null;
const ceDefine = customElements.define;
2022-06-21 12:33:55 +00:00
customElements.define = function (tagName, Ctr) {
Ctr[Symbol.for('tagName')] = tagName;
return ceDefine.call(this, tagName, Ctr);
2022-06-21 12:33:55 +00:00
};