feat: AcfImage component based on @nuxt/image
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { version } from "./package.json";
|
||||
|
||||
const isDev = process.env.NODE_ENV !== "production";
|
||||
|
||||
const siteUrl = process.env.NUXT_SITE_URL;
|
||||
if (!siteUrl) {
|
||||
throw new Error(`NUXT_SITE_URL is not defined. Make sure to set it in your build environment variables.`);
|
||||
@@ -9,6 +11,7 @@ const wpUrl = process.env.NUXT_WP_URL;
|
||||
if (!wpUrl) {
|
||||
throw new Error(`NUXT_WP_URL is not defined. Make sure to set it in your build environment variables.`);
|
||||
}
|
||||
const wpDomain = new URL(wpUrl).hostname;
|
||||
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
@@ -16,6 +19,7 @@ export default defineNuxtConfig({
|
||||
modules: [
|
||||
"@lewebsimple/nuxt-graphql",
|
||||
"@nuxt/eslint",
|
||||
"@nuxt/image",
|
||||
"@nuxt/ui",
|
||||
"@nuxtjs/device",
|
||||
"@nuxtjs/seo",
|
||||
@@ -103,6 +107,11 @@ export default defineNuxtConfig({
|
||||
},
|
||||
},
|
||||
|
||||
image: {
|
||||
...isDev ? {} : { provider: "cloudflare", cloudflare: { baseURL: "/" } },
|
||||
domains: [wpDomain],
|
||||
},
|
||||
|
||||
robots: {
|
||||
sitemap: `${wpUrl}/sitemap_index.xml`,
|
||||
},
|
||||
@@ -114,5 +123,4 @@ export default defineNuxtConfig({
|
||||
componentPrefix: "Svg",
|
||||
defaultImport: "component",
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user