Skip to content

Commit ab0b0a8

Browse files
authored
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
1 parent 26c438b commit ab0b0a8

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/basic-features/image-optimization.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,30 @@ export default Home
4444

4545
- `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)
4646
- `width` and `height` are automatically responsive, unlike the HTML `<img>` element
47+
- `quality` can be configured per image, default 75
4748
- See [`next/image`](/docs/api-reference/next/image.md) for list of available props.
4849

4950
## Configuration
5051

51-
You can configure Image Optimization by using the `images` property in `next.config.js`.
52+
You can optionally configure Image Optimization by using the `images` property in `next.config.js`.
53+
54+
If no configuration is provided, the following default configuration will be used.
55+
56+
```js
57+
module.exports = {
58+
images: {
59+
deviceSizes: [320, 420, 768, 1024, 1200],
60+
iconSizes: [],
61+
domains: [],
62+
path: '/_next/image',
63+
loader: 'default',
64+
},
65+
}
66+
```
67+
68+
If a specific property is omitted, such as `deviceSizes`, that property will use the default above.
69+
70+
This means you only need to configure the properties you wish to change.
5271

5372
### Device Sizes
5473

0 commit comments

Comments
 (0)