// https://nuxt.com/docs/api/configuration/nuxt-config
//import axios from 'axios'

// const getPostRoutes = async () => {
//   const response = await axios.get('https://peerlessoneuatcms.webspiders.com/sites/default/files/json_files/blogs.json');
//   console.log("nuxt config response=======",response.data)
//   return response?.data?.data.map((post) => `${post.attributes.details_url}&id=${post.id}`);
// };

export default defineNuxtConfig({
  // ssr: true,  
  // hooks: {
  //   async 'nitro:config'(nitroConfig) {
  //     // fetch the routes from our function above
  //     const slugs = await getPostRoutes();
  //     // add the routes to the nitro config
  //     nitroConfig.prerender.routes.push(...slugs);
  //   },
  // },
  modules: [
    'nuxt-typed-router',
    '@nuxt/image',
  ],
  css: ["@/assets/css/main.min.css", "@/assets/css/timeline.min.css", "@/assets/css/home.css", "@/assets/css/screen.css"],
  app: {
    head: {
      meta: [
        {
          name: "google-site-verification",
          content: "J9Ex-PkhJ70QQcuSi9_b0iT_VNBpdgew4m5PNu8rouk",
        },
      ],
      // title: 'Peerless One',
      // meta: [
      //   { hid: 'description',
      //     name: 'description',
      //     content: 'Experience the power of all Peerless offerings under one roof'
      //   },
      //   { hid: 'og:title',property: 'og:title', content: 'Peerless One' },
      //   { hid: 'og:description',property: 'og:description', content: 'Experience the power of all Peerless offerings under one roof' },
      //   { property: 'og:type', content: 'website' },
      //   //{ property: 'og:url', content: 'https://nuxt.com' },
      //   { property: 'og:locale', content: 'en_US' },
      //   //{ property: 'og:image', content: 'https://nuxt.com/social.jpg' },
      // ],
      charset: 'utf-8',
      viewport: 'width=device-width, initial-scale=1',
      htmlAttrs: { lang: 'en' },
      link: [
        { rel: 'icon', type: 'image/png', href: '/favicon.ico' },
        { rel: 'preconnect', href: 'https://fonts.googleapis.com' },
        { rel: 'preconnect', href: 'https://fonts.gstatic.com' },
        {
          rel: 'stylesheet',
          href:
            'https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Caveat&family=Poppins:wght@100;300;400;600;700&display=swap'
        },
        {
          as: "font",
          rel: "preload",
          href:
            'https://fonts.gstatic.com/s/poppins/v20/pxiEyp8kv8JHgFVrJJfecg.woff2',
          type: "font/woff2",
          crossorigin: "anonymous"
        },
        {
          as: "font",
          rel: "preload",
          href:
            'https://fonts.gstatic.com/s/bebasneue/v10/JTUSjIg69CK48gW7PXoo9Wlhyw.woff2',
          type: "font/woff2",
          crossorigin: "anonymous"
        },
        {
          as: "font",
          rel: "preload",
          href:
            'https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLEj6Z1xlFQ.woff2',
          type: "font/woff2",
          crossorigin: "anonymous"
        },
        {
          as: "font",
          rel: "preload",
          href:
            'https://fonts.gstatic.com/s/poppins/v20/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2',
          type: "font/woff2",
          crossorigin: "anonymous"
        }
      ],
      script: [
        {
          type: "text/javascript",
          hid: 'minjs',
          src: '/main.min.js',
          async: false,
          defer: true,
          tagPosition: 'bodyClose'
        }
      ]
    }
  },
  build: { transpile: ["@fawmi/vue-google-maps"] },
  runtimeConfig: {
    public: {
      apiBase: process.env.api_base_url,
      environment: process.env.Environment,
      GOOGLE_MAPS_API_KEY: process.env.GOOGLE_MAPS_API_KEY,
      SITE_URL: process.env.SITE_URL,
      FRONT_URL: process.env.FRONT_URL
    }
  }
})