diff --git a/packages/astro/src/frontend/__astro_component.ts b/packages/astro/src/frontend/__astro_component.ts index 0d3d3a299c..f5e029f7cf 100644 --- a/packages/astro/src/frontend/__astro_component.ts +++ b/packages/astro/src/frontend/__astro_component.ts @@ -69,13 +69,15 @@ setup("${astroId}", async () => { const getComponentName = (Component: any, componentProps: any) => { if (componentProps.displayName) return componentProps.displayName; switch (typeof Component) { - case 'function': return Component.displayName ?? Component.name; - case 'string': return Component; + case 'function': + return Component.displayName ?? Component.name; + case 'string': + return Component; default: { return Component; } - } -} + } +}; export const __astro_component = (Component: any, componentProps: AstroComponentProps = {} as any) => { if (Component == null) { diff --git a/packages/astro/src/runtime.ts b/packages/astro/src/runtime.ts index 57f09b6b71..2beb9d7f3f 100644 --- a/packages/astro/src/runtime.ts +++ b/packages/astro/src/runtime.ts @@ -304,10 +304,14 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO (process.env as any).TAILWIND_DISABLE_TOUCH = true; } - const rendererInstances = (await Promise.all(renderers.map((renderer) => { - const entrypoint = pathToFileURL(resolveDependency(renderer)).toString(); - return import(entrypoint); - }))).map(({ default: raw }, i) => { + const rendererInstances = ( + await Promise.all( + renderers.map((renderer) => { + const entrypoint = pathToFileURL(resolveDependency(renderer)).toString(); + return import(entrypoint); + }) + ) + ).map(({ default: raw }, i) => { const { name = renderers[i], client, server, snowpackPlugin: snowpackPluginName, snowpackPluginOptions } = raw; if (typeof client !== 'string') { @@ -376,7 +380,7 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO }, packageOptions: { knownEntrypoints, - external: snowpackExternals + external: snowpackExternals, }, }); diff --git a/packages/renderers/renderer-svelte/Wrapper.svelte.ssr.js b/packages/renderers/renderer-svelte/Wrapper.svelte.ssr.js index cdd544c735..909e719fb9 100644 --- a/packages/renderers/renderer-svelte/Wrapper.svelte.ssr.js +++ b/packages/renderers/renderer-svelte/Wrapper.svelte.ssr.js @@ -1,18 +1,17 @@ /* App.svelte generated by Svelte v3.38.2 */ -import { - create_ssr_component, - missing_component, - validate_component -} from "svelte/internal"; +import { create_ssr_component, missing_component, validate_component } from 'svelte/internal'; const App = create_ssr_component(($$result, $$props, $$bindings, slots) => { - const { __astro_component: Component, __astro_children, ...props } = $$props; + const { __astro_component: Component, __astro_children, ...props } = $$props; - return `${validate_component(Component || missing_component, "svelte:component").$$render($$result, Object.assign(props), {}, { - default: () => `${__astro_children - ? `${__astro_children}` - : ``}` - })}`; + return `${validate_component(Component || missing_component, 'svelte:component').$$render( + $$result, + Object.assign(props), + {}, + { + default: () => `${__astro_children ? `${__astro_children}` : ``}`, + } + )}`; }); export default App;