Skip to content

Commit 88809bb

Browse files
authored
Merge branch 'canary' into docs/add-i18n-manifest-item
2 parents 30ed292 + 2972c06 commit 88809bb

File tree

43 files changed

+483
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+483
-115
lines changed

docs/basic-features/image-optimization.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Next.js supports built-in image optimization, as well as third party loaders for Imgix, Cloudinary, and more! Learn more here.
33
---
44

5-
# Image Optimization
5+
# Image Component and Image Optimization
66

77
<details open>
88
<summary><b>Examples</b></summary>
@@ -50,14 +50,26 @@ export default Home
5050

5151
You can configure Image Optimization by using the `images` property in `next.config.js`.
5252

53-
### Sizes
53+
### Device Sizes
5454

55-
You can specify a list of image widths to allow using the `sizes` property. Since images maintain their aspect ratio using the `width` and `height` attributes of the source image, there is no need to specify height in `next.config.js` – only the width. You can think of these as breakpoints.
55+
You can specify a list of device width breakpoints using the `deviceSizes` property. Since images maintain their aspect ratio using the `width` and `height` attributes of the source image, there is no need to specify height in `next.config.js` – only the width. These values will be used by the browser to determine which size image should load.
5656

5757
```js
5858
module.exports = {
5959
images: {
60-
sizes: [320, 420, 768, 1024, 1200],
60+
deviceSizes: [320, 420, 768, 1024, 1200],
61+
},
62+
}
63+
```
64+
65+
### Icon Sizes
66+
67+
You can specify a list of icon image widths using the `iconSizes` property. These widths should be smaller than the smallest value in `deviceSizes`. The purpose is for images that don't scale with the browser window, such as icons or badges. If `iconSizes` is not defined, then `deviceSizes` will be used.
68+
69+
```js
70+
module.exports = {
71+
images: {
72+
iconSizes: [16, 32, 64],
6173
},
6274
}
6375
```
@@ -90,10 +102,11 @@ module.exports = {
90102

91103
The following Image Optimization cloud providers are supported:
92104

93-
- Imgix - `loader: 'imgix'`
94-
- Cloudinary - `loader: 'cloudinary'`
95-
- Akamai - `loader: 'akamai'`
96-
- Vercel - No configuration necessary
105+
- When using `next start` or a custom server image optimization works automatically.
106+
- [Vercel](https://vercel.com): Works automatically when you deploy on Vercel
107+
- [Imgix](https://www.imgix.com): `loader: 'imgix'`
108+
- [Cloudinary](https://cloudinary.com): `loader: 'cloudinary'`
109+
- [Akamai](https://www.akamai.com): `loader: 'akamai'`
97110

98111
## Related
99112

@@ -105,10 +118,3 @@ For more information on what to do next, we recommend the following sections:
105118
<small>See all available properties for the Image component</small>
106119
</a>
107120
</div>
108-
109-
<div class="card">
110-
- When using `next start` or a custom server image optimization works automatically.
111-
- [Vercel](https://vercel.com): Works automatically when you deploy on Vercel
112-
- [Imgix](https://www.imgix.com): `loader: 'imgix'`
113-
- [Cloudinary](https://cloudinary.com): `loader: 'cloudinary'`
114-
- [Akamai](https://www.akamai.com): `loader: 'akamai'`

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"registry": "https://registry.npmjs.org/"
1818
}
1919
},
20-
"version": "9.5.6-canary.14"
20+
"version": "9.5.6-canary.16"
2121
}

packages/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "9.5.6-canary.14",
3+
"version": "9.5.6-canary.16",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-plugin-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/eslint-plugin-next",
3-
"version": "9.5.6-canary.14",
3+
"version": "9.5.6-canary.16",
44
"description": "ESLint plugin for NextJS.",
55
"main": "lib/index.js",
66
"license": "MIT",

packages/next-bundle-analyzer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/bundle-analyzer",
3-
"version": "9.5.6-canary.14",
3+
"version": "9.5.6-canary.16",
44
"main": "index.js",
55
"license": "MIT",
66
"repository": {

packages/next-codemod/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/codemod",
3-
"version": "9.5.6-canary.14",
3+
"version": "9.5.6-canary.16",
44
"license": "MIT",
55
"dependencies": {
66
"chalk": "4.1.0",

packages/next-env/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/env",
3-
"version": "9.5.6-canary.14",
3+
"version": "9.5.6-canary.16",
44
"keywords": [
55
"react",
66
"next",

packages/next-mdx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/mdx",
3-
"version": "9.5.6-canary.14",
3+
"version": "9.5.6-canary.16",
44
"main": "index.js",
55
"license": "MIT",
66
"repository": {

packages/next-plugin-google-analytics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/plugin-google-analytics",
3-
"version": "9.5.6-canary.14",
3+
"version": "9.5.6-canary.16",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/next-plugin-google-analytics"

packages/next-plugin-sentry/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/plugin-sentry",
3-
"version": "9.5.6-canary.14",
3+
"version": "9.5.6-canary.16",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/next-plugin-sentry"

0 commit comments

Comments
 (0)