summaryrefslogtreecommitdiff
path: root/packages/integrations/svelte/src
diff options
context:
space:
mode:
authorGravatar Emanuele Stoppa <my.burning@gmail.com> 2024-06-05 11:39:42 +0100
committerGravatar GitHub <noreply@github.com> 2024-06-05 11:39:42 +0100
commit803dd8061df02138b4928442bcb76e77dcf6f5e7 (patch)
treec3ed3580e82716ea436dc783fdb31dd8bbc9f647 /packages/integrations/svelte/src
parent587e75f47efa346139b71e5e754e051f72bdac39 (diff)
downloadastro-803dd8061df02138b4928442bcb76e77dcf6f5e7.tar.gz
astro-803dd8061df02138b4928442bcb76e77dcf6f5e7.tar.zst
astro-803dd8061df02138b4928442bcb76e77dcf6f5e7.zip
feat(container): provide a virtual module to load renderers (#11144)
* feat(container): provide a virtual module to load renderers * address feedback * chore: restore some default to allow to have PHP prototype working * Thread through renderers and manifest * Pass manifest too * update changeset * add diff * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * fix diff * rebase and update lock --------- Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Diffstat (limited to 'packages/integrations/svelte/src')
-rw-r--r--packages/integrations/svelte/src/index.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/integrations/svelte/src/index.ts b/packages/integrations/svelte/src/index.ts
index 9c38b9d05..b0db3505c 100644
--- a/packages/integrations/svelte/src/index.ts
+++ b/packages/integrations/svelte/src/index.ts
@@ -1,7 +1,7 @@
import { fileURLToPath } from 'node:url';
import type { Options } from '@sveltejs/vite-plugin-svelte';
import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte';
-import type { AstroIntegration, AstroRenderer } from 'astro';
+import type { AstroIntegration, AstroRenderer, ContainerRenderer } from 'astro';
import { VERSION } from 'svelte/compiler';
import type { UserConfig } from 'vite';
@@ -15,6 +15,13 @@ function getRenderer(): AstroRenderer {
};
}
+export function getContainerRenderer(): ContainerRenderer {
+ return {
+ name: '@astrojs/svelte',
+ serverEntrypoint: isSvelte5 ? '@astrojs/svelte/server-v5.js' : '@astrojs/svelte/server.js',
+ };
+}
+
async function svelteConfigHasPreprocess(root: URL) {
const svelteConfigFiles = ['./svelte.config.js', './svelte.config.cjs', './svelte.config.mjs'];
for (const file of svelteConfigFiles) {