summaryrefslogtreecommitdiff
path: root/packages/integrations/lit/server-shim.js
blob: 9a4c7e408ed08ac20ef562e3e2f2e1edef8a7fc9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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;
customElements.define = function (tagName, Ctr) {
	Ctr[Symbol.for('tagName')] = tagName;
	return ceDefine.call(this, tagName, Ctr);
};