Skip to content

Commit

Permalink
apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Dec 4, 2024
1 parent d7e749f commit 26c65f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions packages/astro/src/core/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,11 @@ export const AstroConfigSchema = z.object({
svg: z
.union([
z.boolean(),
z.object({
mode: z.union([z.literal('inline'), z.literal('sprite')]),
}),
z
.object({
mode: z.union([z.literal('inline'), z.literal('sprite')]).optional(),
})
.optional(),
])
.optional()
.default(ASTRO_CONFIG_DEFAULTS.experimental.svg)
Expand All @@ -553,6 +555,12 @@ export const AstroConfigSchema = z.object({
mode: 'inline' as SvgRenderMode,
}
: undefined;
} else {
if (!svgConfig.mode) {
return {
mode: 'inline' as SvgRenderMode,
};
}
}
return svgConfig;
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { defineConfig } from 'astro/config';
export default defineConfig({
integrations: [mdx()],
experimental: {
svg: true
svg: {}
}
});

0 comments on commit 26c65f2

Please sign in to comment.