[Vuejs]-Some css will not load in production mode in nuxt.js

0πŸ‘

{
      src: '~/plugins/vuex-persist',
      mode: 'client',
      ssr: false
    },

or

{
      src: '~/plugins/vuex-persist',
      mode: 'server',
      ssr: false
    },
πŸ‘€Mr A B.a

-1πŸ‘

The problem is fixed by providing css file in head section of nuxt.config.js :

   link: [{
        rel: 'icon',
        type: 'image/x-icon',
        href: '/favicon.ico'
      },
      {
        rel: 'preload',
        as: 'style',
        onload: "this.onload=null;this.rel='stylesheet'",
        href: '/vue-select.css',
      }

    ]

however it will be considered as a render blocking resource by google page inspection and this is SEO issue. so i will add these 3 properties:

    rel: 'preload',
    as: 'style',
    onload: "this.onload=null;this.rel='stylesheet'",
πŸ‘€Ali saberi

Leave a comment