Open badoubadou opened 3 years ago
Hi, I don't understand why my app has meta robots set to noindex when I'm in production mode only ?? Here is my nuxt.config
import i18n from './config/i18n' let envBaseUrlAdmin = null let envBaseUrl = null switch (process.env.NODE_ENV) { case 'production': envBaseUrlAdmin = 'https://web-admin.exmple.com' envBaseUrl = 'https://web.exmple.com' break case 'development': envBaseUrlAdmin = 'https://motion-admin.exmple.com' envBaseUrl = 'https://motion.exmple.com' break case 'staging': envBaseUrlAdmin = 'https://motion-admin.exmple.com' envBaseUrl = 'https://motion.exmple.com' break default: envBaseUrlAdmin = 'https://web-admin.exmple.com' envBaseUrl = 'https://web.exmple.com' } export default { // Global page headers: https://go.nuxtjs.dev/config-head head: { title: 'title', htmlAttrs: { lang: 'en' }, meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: '' }, { name: 'msapplication-TileColor', content: '#da532c' }, { name: 'theme-color', content: '#ffffff' }, { hid: 'robots', name: 'robots', content: 'index, follow' } ], link: [ { rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' }, { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }, { rel: 'apple-touch-icon', sizes: '32x32', href: '/favicon-32x32.png' }, { rel: 'apple-touch-icon', sizes: '16x16', href: '/favicon-16x16.png' }, { rel: 'manifest', href: '/site.webmanifest' }, { rel: 'mask-icon', color: '#5bbad5', href: '/safari-pinned-tab.svg' }, { rel: 'manifest', href: '/site.webmanifest' } ] }, // Global CSS: https://go.nuxtjs.dev/config-css css: [ '~/assets/style/main', 'aos/dist/aos.css' ], // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins plugins: [{ src: "~/plugins/aos", ssr: false }], // Auto import components: https://go.nuxtjs.dev/config-components components: true, // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules buildModules: ['nuxt-lazysizes', [ 'nuxt-i18n', { strategy: 'prefix_except_default', defaultLocale: 'en', seo: true, baseUrl: envBaseUrl, locales: [ { code: 'en', name: 'English', iso: 'en-GB' }, { code: 'fr', name: 'Français', iso: 'fr-FR' } ], vueI18n: i18n } ] ], lazySizes: { /* module options */ }, // Modules: https://go.nuxtjs.dev/config-modules modules: [ '@nuxtjs/axios', [ 'nuxt-mq', { // Default breakpoint for SSR defaultBreakpoint: 'sm', breakpoints: { sm: 868, md: 1050, lg: Infinity } } ], [ 'nuxt-compress', { gzip: { threshold: 8192, }, brotli: { threshold: 8192, }, }, ], ], env: { baseUrl: envBaseUrlAdmin }, // Build Configuration: https://go.nuxtjs.dev/config-build build: { } }
I even set the meta in the layout /default.vue This is driving me insane !!
head () { return { meta: [{ hid: 'robots', name: 'robots', content: 'index, follow' }], } }
Hi, I don't understand why my app has meta robots set to noindex when I'm in production mode only ?? Here is my nuxt.config