未验证 提交 1a8cb7e1 编写于 作者: A Alex Castle 提交者: GitHub

Image Component: Support for Akamai image CDN (#18100)

上级 548d1939
......@@ -4,6 +4,7 @@ import Head from '../next-server/lib/head'
const loaders: { [key: string]: (props: LoaderProps) => string } = {
imgix: imgixLoader,
cloudinary: cloudinaryLoader,
akamai: akamaiLoader,
default: defaultLoader,
}
......@@ -308,6 +309,10 @@ function imgixLoader({ root, src, width, quality }: LoaderProps): string {
return `${root}${normalizeSrc(src)}${paramsString}`
}
function akamaiLoader({ root, src, width }: LoaderProps): string {
return `${root}${normalizeSrc(src)}${width ? '?imwidth=' + width : ''}`
}
function cloudinaryLoader({ root, src, width, quality }: LoaderProps): string {
const params = []
let paramsString = ''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册