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,
|
split: false,
|
||||||
excludeMiddleware: false,
|
excludeMiddleware: false,
|
||||||
},
|
},
|
||||||
|
image: {
|
||||||
|
service: { entrypoint: 'astro/assets/services/sharp', config: {} },
|
||||||
|
},
|
||||||
compressHTML: true,
|
compressHTML: true,
|
||||||
server: {
|
server: {
|
||||||
host: false,
|
host: false,
|
||||||
|
@ -180,14 +183,18 @@ export const AstroConfigSchema = z.object({
|
||||||
.default(ASTRO_CONFIG_DEFAULTS.redirects),
|
.default(ASTRO_CONFIG_DEFAULTS.redirects),
|
||||||
image: z
|
image: z
|
||||||
.object({
|
.object({
|
||||||
service: z.object({
|
service: z
|
||||||
entrypoint: z.union([
|
.object({
|
||||||
z.literal('astro/assets/services/sharp'),
|
entrypoint: z
|
||||||
z.literal('astro/assets/services/squoosh'),
|
.union([
|
||||||
z.string(),
|
z.literal('astro/assets/services/sharp'),
|
||||||
]),
|
z.literal('astro/assets/services/squoosh'),
|
||||||
config: z.record(z.any()).default({}),
|
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([]),
|
domains: z.array(z.string()).default([]),
|
||||||
remotePatterns: z
|
remotePatterns: z
|
||||||
.array(
|
.array(
|
||||||
|
@ -213,9 +220,7 @@ export const AstroConfigSchema = z.object({
|
||||||
)
|
)
|
||||||
.default([]),
|
.default([]),
|
||||||
})
|
})
|
||||||
.default({
|
.default(ASTRO_CONFIG_DEFAULTS.image),
|
||||||
service: { entrypoint: 'astro/assets/services/sharp', config: {} },
|
|
||||||
}),
|
|
||||||
markdown: z
|
markdown: z
|
||||||
.object({
|
.object({
|
||||||
drafts: z.boolean().default(false),
|
drafts: z.boolean().default(false),
|
||||||
|
|
Loading…
Reference in a new issue