diff options
author | 2022-04-21 11:12:21 -0400 | |
---|---|---|
committer | 2022-04-21 11:12:21 -0400 | |
commit | e85b16e2b3d846333f542139c82640de19bfd2f5 (patch) | |
tree | 3a96b15b72ba2bc7e48fe56b753f80fbda800d0a /packages/integrations/lit/src | |
parent | add650a47f8c812d01f0601bc14b43c457f2beba (diff) | |
download | astro-e85b16e2b3d846333f542139c82640de19bfd2f5.tar.gz astro-e85b16e2b3d846333f542139c82640de19bfd2f5.tar.zst astro-e85b16e2b3d846333f542139c82640de19bfd2f5.zip |
Make 'lit' always be bundled in SSR (#3164)
* Make 'lit' always be bundled in SSR
* Adds a changeset
Diffstat (limited to 'packages/integrations/lit/src')
-rw-r--r-- | packages/integrations/lit/src/index.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/integrations/lit/src/index.ts b/packages/integrations/lit/src/index.ts index f945f1ca3..4635f9d5d 100644 --- a/packages/integrations/lit/src/index.ts +++ b/packages/integrations/lit/src/index.ts @@ -1,5 +1,5 @@ import { readFileSync } from 'node:fs'; -import type { AstroIntegration } from 'astro'; +import type { AstroConfig, AstroIntegration } from 'astro'; function getViteConfiguration() { return { @@ -45,6 +45,19 @@ export default function (): AstroIntegration { vite: getViteConfiguration(), }); }, + 'astro:build:setup': ({ vite, target }) => { + if (target === 'server') { + if(!vite.ssr) { + vite.ssr = {}; + } + if(!vite.ssr.noExternal) { + vite.ssr.noExternal = []; + } + if(Array.isArray(vite.ssr.noExternal)) { + vite.ssr.noExternal.push('lit') + } + } + }, }, }; } |