Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Svelte preprocess integration handling #5901

Merged
merged 8 commits into from
Jan 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix types
bluwy committed Jan 19, 2023
commit 47be52c97a052c5b087b4697ef823611f9ec6c00
6 changes: 3 additions & 3 deletions packages/integrations/svelte/src/index.ts
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ type ViteConfigurationArgs = {
root: URL;
};

async function getViteConfiguration({ options, isDev, root }: ViteConfigurationArgs): UserConfig {
async function getViteConfiguration({ options, isDev, root }: ViteConfigurationArgs): Promise<UserConfig> {
const defaultOptions: Partial<Options> = {
emitCss: true,
compilerOptions: { dev: isDev, hydratable: true },
@@ -77,10 +77,10 @@ export default function (options?: Options | OptionsCallback): AstroIntegration
name: '@astrojs/svelte',
hooks: {
// Anything that gets returned here is merged into Astro Config
'astro:config:setup': ({ command, updateConfig, addRenderer, config }) => {
'astro:config:setup': async ({ command, updateConfig, addRenderer, config }) => {
addRenderer(getRenderer());
updateConfig({
vite: getViteConfiguration({
vite: await getViteConfiguration({
options,
isDev: command === 'dev',
root: config.root,