Source code like this:
Why does this problem arise?
Our normal front-end projects will have css and js files one by one, but the Nuxt project is integrated together after being packaged by webpack.
这是把element-ui的组件中的样式全部整合进来了。
We know that web crawlers cannot dynamically compile JS when crawling your webpage data, but the css like the above can be crawled.
The source code of the webpage that the crawler gets contains these useless information (it is useless to the crawler and will reduce their judgment on the quality of the webpage), and it will also impress the response speed of the website, which is not conducive to the SEO of the website!
solution:
Modify the nuxt.config file
// 将内嵌CSS样式提取到外部
extractCSS: {
allChunks: true },
Just look at the source code again. . .