Nuxt project web page source code contains a lot of css problem solutions

Source code like this:
insert image description here

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 },

insert image description here
Just look at the source code again. . .

Guess you like

Origin blog.csdn.net/BubbleABC/article/details/130891490