mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
fix: settings requiring service to be set when settings domains or remotePatterns (#8266)
This commit is contained in:
parent
a78175c1b8
commit
8450379db8
2 changed files with 21 additions and 11 deletions
5
.changeset/many-impalas-sit.md
Normal file
5
.changeset/many-impalas-sit.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix `image.service` requiring to be set manually when `image.domains` or `image.remotePatterns` was assigned a value
|
|
@ -29,6 +29,9 @@ const ASTRO_CONFIG_DEFAULTS = {
|
|||
split: false,
|
||||
excludeMiddleware: false,
|
||||
},
|
||||
image: {
|
||||
service: { entrypoint: 'astro/assets/services/sharp', config: {} },
|
||||
},
|
||||
compressHTML: true,
|
||||
server: {
|
||||
host: false,
|
||||
|
@ -180,14 +183,18 @@ export const AstroConfigSchema = z.object({
|
|||
.default(ASTRO_CONFIG_DEFAULTS.redirects),
|
||||
image: z
|
||||
.object({
|
||||
service: z.object({
|
||||
entrypoint: z.union([
|
||||
z.literal('astro/assets/services/sharp'),
|
||||
z.literal('astro/assets/services/squoosh'),
|
||||
z.string(),
|
||||
]),
|
||||
config: z.record(z.any()).default({}),
|
||||
}),
|
||||
service: z
|
||||
.object({
|
||||
entrypoint: z
|
||||
.union([
|
||||
z.literal('astro/assets/services/sharp'),
|
||||
z.literal('astro/assets/services/squoosh'),
|
||||
z.string(),
|
||||
])
|
||||
.default(ASTRO_CONFIG_DEFAULTS.image.service.entrypoint),
|
||||
config: z.record(z.any()).default({}),
|
||||
})
|
||||
.default(ASTRO_CONFIG_DEFAULTS.image.service),
|
||||
domains: z.array(z.string()).default([]),
|
||||
remotePatterns: z
|
||||
.array(
|
||||
|
@ -213,9 +220,7 @@ export const AstroConfigSchema = z.object({
|
|||
)
|
||||
.default([]),
|
||||
})
|
||||
.default({
|
||||
service: { entrypoint: 'astro/assets/services/sharp', config: {} },
|
||||
}),
|
||||
.default(ASTRO_CONFIG_DEFAULTS.image),
|
||||
markdown: z
|
||||
.object({
|
||||
drafts: z.boolean().default(false),
|
||||
|
|
Loading…
Reference in a new issue