/
invalid-loader.js
50 lines (48 loc) · 1.14 KB
/
invalid-loader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from 'react'
import Image from 'next/image'
const Page = () => {
return (
<div>
<h1>Warn for this loader that doesnt use width</h1>
<Image
id="no-width"
src="/test.png"
width={100}
height={100}
loader={({ src }) => `${src}`}
/>
<Image
id="width-path"
src="/test.jpg"
width={100}
height={100}
loader={({ src, width }) => `${src}/${width}/file.jpg`}
/>
<Image
id="width-querystring-w"
src="/test.webp"
width={100}
height={100}
loader={({ src, width }) => `${src}?w=${width / 2}`}
/>
<Image
id="width-querystring-width"
src="/test.gif"
width={100}
height={100}
loader={({ src, width }) =>
`https://example.vercel.sh${src}?width=${width * 2}`
}
/>
<Image
id="width-querystring-size"
src="/test.tiff"
width={100}
height={100}
loader={({ src }) => `https://example.vercel.sh${src}?size=medium`}
/>
<footer>footer</footer>
</div>
)
}
export default Page