disable SSR

This commit is contained in:
Cory LaViska
2025-02-06 16:33:54 -05:00
parent 884e11c6d7
commit 70b486fa96
2 changed files with 0 additions and 32 deletions

View File

@@ -117,29 +117,6 @@ export default function (eleventyConfig) {
]),
);
// SSR plugin
if (!isDev) {
//
// Problematic components in SSR land:
// - animation (breaks on navigation + ssr with Turbo)
// - mutation-observer (why SSR this?)
// - resize-observer (why SSR this?)
// - tooltip (why SSR this?)
//
const omittedModules = [];
const componentModules = componentList
.filter(component => !omittedModules.includes(component.tagName.split(/wa-/)[1]))
.map(component => {
const name = component.tagName.split(/wa-/)[1];
return `./dist/components/${name}/${name}.js`;
});
eleventyConfig.addPlugin(litPlugin, {
mode: 'worker',
componentModules,
});
}
// Build the search index
eleventyConfig.addPlugin(
searchPlugin({

View File

@@ -1,4 +1,3 @@
import { litSsrPlugin } from '@lit-labs/testing/web-test-runner-ssr-plugin.js';
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { playwrightLauncher } from '@web/test-runner-playwright';
import { readFileSync } from 'fs';
@@ -53,7 +52,6 @@ export default {
ts: true,
target: 'es2020',
}),
litSsrPlugin(),
],
browsers: [
playwrightLauncher({ product: 'chromium', concurrency }),
@@ -78,15 +76,8 @@ export default {
${componentImports.map(str => `"${str}"`).join(',\n')}
]
window.SSR_ONLY = ${process.env['SSR_ONLY'] === 'true'}
window.CSR_ONLY = ${process.env['CSR_ONLY'] === 'true'}
</script>
<script type="module">
;(async () => {
await import('@lit-labs/ssr-client/lit-element-hydrate-support.js')
await Promise.allSettled(window.clientComponents.map(str => import(str)));
})()
</script>
<script type="module" src="${testFramework}"></script>
</head>
<body>