Unverified Commit ab0b0a8a authored by Steven's avatar Steven Committed by GitHub

Update docs - add default config for images property (#18296)

- Explain how defaults work and what the default values are.
- Mention quality on the basic page
parent 26c438b4
...@@ -44,11 +44,30 @@ export default Home ...@@ -44,11 +44,30 @@ export default Home
- `width` and `height` are required to prevent [Cumulative Layout Shift](https://web.dev/cls/), a [Core Web Vital](https://web.dev/vitals/) that Google is going to [use in their search ranking](https://webmasters.googleblog.com/2020/05/evaluating-page-experience.html) - `width` and `height` are required to prevent [Cumulative Layout Shift](https://web.dev/cls/), a [Core Web Vital](https://web.dev/vitals/) that Google is going to [use in their search ranking](https://webmasters.googleblog.com/2020/05/evaluating-page-experience.html)
- `width` and `height` are automatically responsive, unlike the HTML `<img>` element - `width` and `height` are automatically responsive, unlike the HTML `<img>` element
- `quality` can be configured per image, default 75
- See [`next/image`](/docs/api-reference/next/image.md) for list of available props. - See [`next/image`](/docs/api-reference/next/image.md) for list of available props.
## Configuration ## Configuration
You can configure Image Optimization by using the `images` property in `next.config.js`. You can optionally configure Image Optimization by using the `images` property in `next.config.js`.
If no configuration is provided, the following default configuration will be used.
```js
module.exports = {
images: {
deviceSizes: [320, 420, 768, 1024, 1200],
iconSizes: [],
domains: [],
path: '/_next/image',
loader: 'default',
},
}
```
If a specific property is omitted, such as `deviceSizes`, that property will use the default above.
This means you only need to configure the properties you wish to change.
### Device Sizes ### Device Sizes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment