added format command and added trailing commas to reduce conflicts

This commit is contained in:
dswbx
2025-02-26 20:06:03 +01:00
parent 88b5359f1c
commit 7743f71a11
414 changed files with 3622 additions and 3610 deletions

View File

@@ -11,7 +11,7 @@ export function ImageOptimizationPlugin({
accessUrl = "/_plugin/image/optimize",
resolvePath = "/api/media/file",
autoFormat = true,
devBypass
devBypass,
}: ImageOptimizationPluginOptions = {}) {
const disallowedAccessUrls = ["/api", "/admin", "/_optimize"];
if (disallowedAccessUrls.includes(accessUrl) || accessUrl.length < 2) {
@@ -63,7 +63,7 @@ export function ImageOptimizationPlugin({
// Build a request that passes through request headers
const imageRequest = new Request(imageURL, {
headers: request.headers
headers: request.headers,
});
// Returning fetch() with resizing options will pass through response with the resized image.
@@ -75,8 +75,8 @@ export function ImageOptimizationPlugin({
headers: {
"Cache-Control": "public, max-age=600",
"Content-Type": metadata.type,
"Content-Length": metadata.size.toString()
}
"Content-Length": metadata.size.toString(),
},
});
});
};