0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/renderers/renderer-lit/index.js
2022-04-02 14:15:41 -06:00

37 lines
1 KiB
JavaScript

// NOTE: @lit-labs/ssr uses syntax incompatible with anything < Node v13.9.0.
// Throw an error if using that Node version.
const NODE_VERSION = parseFloat(process.versions.node);
if (NODE_VERSION < 13.9) {
throw new Error(
`Package @lit-labs/ssr requires Node version v13.9 or higher. Please update Node to use @astrojs/renderer-lit`
);
}
export default {
name: '@astrojs/renderer-lit',
server: './server.js',
polyfills: ['./client-shim.js'],
hydrationPolyfills: ['./hydration-support.js'],
viteConfig() {
return {
optimizeDeps: {
include: [
'@astrojs/renderer-lit/client-shim.js',
'@astrojs/renderer-lit/hydration-support.js',
'@webcomponents/template-shadowroot/template-shadowroot.js',
'lit/experimental-hydrate-support.js',
],
exclude: ['@astrojs/renderer-lit/server.js'],
},
ssr: {
external: [
'lit-element/lit-element.js',
'@lit-labs/ssr/lib/install-global-dom-shim.js',
'@lit-labs/ssr/lib/render-lit-html.js',
'@lit-labs/ssr/lib/lit-element-renderer.js',
],
},
};
},
};