Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify config.image.breakpoints to config.image.sizes #17953

Merged
merged 1 commit into from Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next/client/image.tsx
Expand Up @@ -27,7 +27,7 @@ type ImageProps = {
}

let imageData: any = process.env.__NEXT_IMAGE_OPTS
const breakpoints = imageData.breakpoints || [640, 1024, 1600]
const breakpoints = imageData.sizes || [640, 1024, 1600]

function computeSrc(src: string, host: string, unoptimized: boolean): string {
if (unoptimized) {
Expand Down
Expand Up @@ -16,13 +16,13 @@ describe('Next.config.js images prop without default host', () => {
nextConfig,
`module.exports = {
images: {
sizes: [480, 1024, 1600],
hosts: {
secondary: {
path: 'https://examplesecondary.com/images/',
loader: 'cloudinary',
},
},
breakpoints: [480, 1024, 1600],
},
}`,
'utf8'
Expand All @@ -46,6 +46,7 @@ describe('Next.config.js images prop without path', () => {
nextConfig,
`module.exports = {
images: {
sizes: [480, 1024, 1600],
hosts: {
default: {
path: 'https://examplesecondary.com/images/',
Expand All @@ -55,7 +56,6 @@ describe('Next.config.js images prop without path', () => {
loader: 'cloudinary',
},
},
breakpoints: [480, 1024, 1600],
},
}`,
'utf8'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/image-component/basic/next.config.js
@@ -1,5 +1,6 @@
module.exports = {
images: {
sizes: [480, 1024, 1600],
hosts: {
default: {
path: 'https://example.com/myaccount/',
Expand All @@ -10,6 +11,5 @@ module.exports = {
loader: 'cloudinary',
},
},
breakpoints: [480, 1024, 1600],
},
}