Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Lit support in the static build #2370

Merged
merged 12 commits into from
Jan 14, 2022
Prev Previous commit
Next Next commit
Testing again
  • Loading branch information
matthewp committed Jan 14, 2022
commit a0d9d5d5929cd239e6d38a231322ad64c26b7e8d
12 changes: 7 additions & 5 deletions packages/renderers/renderer-lit/server-shim.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import '@lit-labs/ssr/lib/install-global-dom-shim.js';
if(typeof window !== 'undefined') {
window.global = window;
document.getElementsByTagName = () => [];
}
import { installWindowOnGlobal } from "@lit-labs/ssr/lib/dom-shim.js";
console.log('before', typeof window);
installWindowOnGlobal();
console.log('after', typeof window, typeof globalThis.window);
window.global = window;

document.getElementsByTagName = () => [];