S
S
Shurik2021-01-18 15:53:49
Vue.js
Shurik, 2021-01-18 15:53:49

How to correctly make meta tags for PS bots in vue?

Hello. In the vue application, I set up meta tags using 'vue-meta' (by writing metaInfo() in each of the components). In the browser, in the element inspector, everything works and is displayed, but the search engine bots stubbornly do not want to see them.
I read about "prerender-spa-plugin", generated statics, as shown in the instructions, but still my meta tags specified in the metaInfo() of the components do not fall. What could be the problem? Who faced?
Below plugin setup in vue.conf.js

....
configureWebpack: {
    plugins: [
      new PrerenderSPAPlugin({
        staticDir: path.join(__dirname, 'dist'),
        indexPath: path.resolve('../web/dist/index.html'),
        routes: [ '/',],
      })
    ],
  },

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shurik, 2021-01-18
@svisch

installed plugin for vue

vue add prerender-spa
instead of the npm module according to this instruction https://www.npmjs.com/package/vue-cli-plugin-prere...
In principle, the meta tags are rendered to static, but the page content still remains empty ((

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question