@webstudio-is/image 0.97.0 → 0.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +2 -2
- package/lib/types/image-optimize.d.ts +1 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -156,7 +156,7 @@ var imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
|
|
|
156
156
|
|
|
157
157
|
// src/image-loaders.ts
|
|
158
158
|
import warnOnce from "warn-once";
|
|
159
|
-
var createImageLoader = (loaderOptions) => ({ width, src, quality }) => {
|
|
159
|
+
var createImageLoader = (loaderOptions) => ({ width, src, quality, format }) => {
|
|
160
160
|
if (true) {
|
|
161
161
|
warnOnce(
|
|
162
162
|
allSizes.includes(width) === false,
|
|
@@ -167,7 +167,7 @@ var createImageLoader = (loaderOptions) => ({ width, src, quality }) => {
|
|
|
167
167
|
const searchParams = new URLSearchParams();
|
|
168
168
|
searchParams.set("width", width.toString());
|
|
169
169
|
searchParams.set("quality", quality.toString());
|
|
170
|
-
searchParams.set("format", "auto");
|
|
170
|
+
searchParams.set("format", format ?? "auto");
|
|
171
171
|
return `${imageBaseUrl}${src}?${searchParams.toString()}`;
|
|
172
172
|
};
|
|
173
173
|
export {
|