export default {
  // Target: https://go.nuxtjs.dev/config-target
  target: 'static',

  server: {
    host: '0.0.0.0'
  },

  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: process.env.NAME,
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      {
        hid: 'description',
        name: 'description',
        content: process.env.DESCRIPTION,
      },
      { hid: 'keywords', name: 'keywords', content: process.env.KEYWORDS },
      { hid: 'og:type', property: 'og:type', content: 'website' },
      { hid: 'og:url', property: 'og:url', content: process.env.BASE_URL },
      {
        hid: 'og:site_name',
        property: 'og:site_name',
        content: process.env.NAME,
      },
      {
        hid: 'og:image',
        property: 'og:image',
        content: process.env.BASE_URL + '/og-image.png',
      },
      { hid: 'og:title', property: 'og:title', content: process.env.NAME },
      {
        hid: 'og:description',
        property: 'og:description',
        content: process.env.DESCRIPTION,
      },
      { name: 'format-detection', content: 'telephone=no' },
    ],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
    // https://go.nuxtjs.dev/typescript
    '@nuxt/typescript-build',
    // https://go.nuxtjs.dev/stylelint
    '@nuxtjs/stylelint-module',
    // https://go.nuxtjs.dev/tailwindcss
    '@nuxtjs/tailwindcss',
    // https://color-mode.nuxtjs.org/
    '@nuxtjs/color-mode',
    // https://image.nuxtjs.org/
    '@nuxt/image'
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
    // https://go.nuxtjs.dev/pwa
    '@nuxtjs/pwa',
    // https://i18n.nuxtjs.org
    '@nuxtjs/i18n',
    'nuxt-vuex-localstorage',
    // Doc: https://github.com/nuxt-community/sitemap-module
    '@nuxtjs/sitemap',
    // https://github.com/nuxt-community/robots-module#readme
    '@nuxtjs/robots',
    // https://google-fonts.nuxtjs.or
    '@nuxtjs/google-fonts',
  ],

  // Axios module configuration: https://go.nuxtjs.dev/config-axios
  axios: {
    // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
    baseURL: process.env.BASE_URL || '/',
  },

  // PWA module configuration: https://go.nuxtjs.dev/pwa
  pwa: {
    meta: {
      author: 'Controlla',
    },

    manifest: {
      name: process.env.NAME,
      short_name: process.env.SHORT_NAME,
      description: process.env.DESCRIPTION,
      lang: 'es',
      theme_color: process.env.THEME_COLOR,
      background_color: process.env.THEME_COLOR,
    },
  },

  // i18n module configuration: https://i18n.nuxtjs.org/setup
  i18n: {
    locales: [
      {
        code: 'en',
        file: 'en.json'
      },
      {
        code: 'es',
        file: 'es.json'
      }
    ],
    langDir: 'lang/',
    defaultLocale: 'es'
  },

  /*
   ** Sitemap module configuration
   ** See https://github.com/nuxt-community/sitemap-module#sitemap-options
   */
  sitemap: {
    hostname: process.env.BASE_URL,
    gzip: true,
    exclude: ['/admin/**'],
    defaults: {
      changefreq: 'daily',
      priority: 1,
      lastmod: new Date(),
      lastmodrealtime: true,
    },
  },

  // Robots module configuration: https://github.com/nuxt-community/robots-module#readme
  robots: {
    UserAgent: () => ['*'],
    Disallow: () => ['/admin'],
    Sitemap: () => [`${process.env.BASE_URL}/sitemap.xml`],
  },

  // Color mode module configuration: https://color-mode.nuxtjs.org/
  colorMode: {
    classSuffix: '',
  },

  // Build Configuration: https://go.nuxtjs.dev/config-build
  generate: {
    dir: 'controlla'
  },
  build: {
    transpile: ['gsap']
  },
}
