Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Sep 7, 2023
1 parent 9b9baec commit 64555e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/integrations/vercel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ export default defineConfig({
Configuration options for [Vercel's Image Optimization API](https://vercel.com/docs/concepts/image-optimization). See [Vercel's image configuration documentation](https://vercel.com/docs/build-output-api/v3/configuration#images) for a complete list of supported parameters.
The `domains` and `remotePatterns` properties will automatically be filled using [the Astro corresponding `image` settings](https://docs.astro.build/en/reference/configuration-reference/#image-options).
```js
// astro.config.mjs
import { defineConfig } from 'astro/config';
Expand Down
13 changes: 12 additions & 1 deletion packages/integrations/vercel/src/serverless/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,18 @@ You can set functionPerRoute: false to prevent surpassing the limit.`
...routeDefinitions,
],
...(imageService || imagesConfig
? { images: imagesConfig ? imagesConfig : getDefaultImageConfig(_config.image) }
? {
images: imagesConfig
? {
...imagesConfig,
domains: [...imagesConfig.domains, ..._config.image.domains],
remotePatterns: [
...(imagesConfig.remotePatterns ?? []),
..._config.image.remotePatterns,
],
}
: getDefaultImageConfig(_config.image),
}
: {}),
});

Expand Down
13 changes: 12 additions & 1 deletion packages/integrations/vercel/src/static/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,18 @@ export default function vercelStatic({
{ handle: 'filesystem' },
],
...(imageService || imagesConfig
? { images: imagesConfig ? imagesConfig : getDefaultImageConfig(_config.image) }
? {
images: imagesConfig
? {
...imagesConfig,
domains: [...imagesConfig.domains, ..._config.image.domains],
remotePatterns: [
...(imagesConfig.remotePatterns ?? []),
..._config.image.remotePatterns,
],
}
: getDefaultImageConfig(_config.image),
}
: {}),
});
},
Expand Down

0 comments on commit 64555e4

Please sign in to comment.