fix: ENABLE_CLOUDFLARE_IMAGE
This commit is contained in:
@@ -11,8 +11,7 @@ if (!wpUrl) {
|
|||||||
}
|
}
|
||||||
const wpDomain = new URL(wpUrl).hostname;
|
const wpDomain = new URL(wpUrl).hostname;
|
||||||
|
|
||||||
const isDev = process.env.NODE_ENV !== "production";
|
const enableCloudflareImage = Boolean(process.env.ENABLE_CLOUDFLARE_IMAGE);
|
||||||
const isWranglerDev = process.env.WRANGLER_ENV === "dev";
|
|
||||||
|
|
||||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
@@ -103,7 +102,7 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
image: {
|
image: {
|
||||||
provider: isDev || isWranglerDev ? "none" : "cloudflare",
|
provider: enableCloudflareImage ? "cloudflare" : "none",
|
||||||
cloudflare: { baseURL: `${siteUrl}/` },
|
cloudflare: { baseURL: `${siteUrl}/` },
|
||||||
domains: [wpDomain],
|
domains: [wpDomain],
|
||||||
format: ["avif", "webp"],
|
format: ["avif", "webp"],
|
||||||
|
|||||||
Reference in New Issue
Block a user