@vistagenic/vista 0.2.9 → 0.2.10
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.
|
@@ -31,8 +31,13 @@ function getImgProps(props, config = image_config_1.imageConfigDefault, defaultL
|
|
|
31
31
|
// Handle Dimensions
|
|
32
32
|
let widthInt = width ? Number(width) : undefined;
|
|
33
33
|
let heightInt = height ? Number(height) : undefined;
|
|
34
|
+
const vercelStaticBuild = typeof window === 'undefined' &&
|
|
35
|
+
(process.env.VERCEL === '1' || typeof process.env.VERCEL_URL === 'string');
|
|
36
|
+
// Disable optimizer when explicitly requested, configured globally,
|
|
37
|
+
// or when building for Vercel static output (no /_vista/image endpoint).
|
|
38
|
+
const disableOptimization = !!unoptimized || !!config.unoptimized || vercelStaticBuild;
|
|
34
39
|
// Generate SrcSet
|
|
35
|
-
const srcSet = generateSrcSet(src, widthInt, loader, config,
|
|
40
|
+
const srcSet = generateSrcSet(src, widthInt, loader, config, disableOptimization);
|
|
36
41
|
return {
|
|
37
42
|
...rest,
|
|
38
43
|
src,
|