0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

[ci] format

This commit is contained in:
bholmesdev 2022-06-22 23:55:00 +00:00 committed by github-actions[bot]
parent 3d554fdbfb
commit 9133a42831

View file

@ -1,8 +1,8 @@
import type { Options } from '@sveltejs/vite-plugin-svelte'; import type { Options } from '@sveltejs/vite-plugin-svelte';
import type { AstroIntegration, AstroRenderer, AstroConfig } from 'astro';
import type { UserConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'; import { svelte } from '@sveltejs/vite-plugin-svelte';
import type { AstroConfig, AstroIntegration, AstroRenderer } from 'astro';
import preprocess from 'svelte-preprocess'; import preprocess from 'svelte-preprocess';
import type { UserConfig } from 'vite';
function getRenderer(): AstroRenderer { function getRenderer(): AstroRenderer {
return { return {
@ -16,9 +16,13 @@ type ViteConfigurationArgs = {
isDev: boolean; isDev: boolean;
options?: Options | OptionsCallback; options?: Options | OptionsCallback;
postcssConfig: AstroConfig['style']['postcss']; postcssConfig: AstroConfig['style']['postcss'];
} };
function getViteConfiguration({ options, postcssConfig, isDev }: ViteConfigurationArgs): UserConfig { function getViteConfiguration({
options,
postcssConfig,
isDev,
}: ViteConfigurationArgs): UserConfig {
const defaultOptions: Partial<Options> = { const defaultOptions: Partial<Options> = {
emitCss: true, emitCss: true,
compilerOptions: { dev: isDev, hydratable: true }, compilerOptions: { dev: isDev, hydratable: true },
@ -76,7 +80,7 @@ export default function (options?: Options | OptionsCallback): AstroIntegration
options, options,
isDev: command === 'dev', isDev: command === 'dev',
postcssConfig: config.style.postcss, postcssConfig: config.style.postcss,
}) }),
}); });
}, },
}, },