In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces vue how to remove redundant styles, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Remove redundant styles
As the project becomes larger and larger, careless writing will lead to some extra css. Small projects are fine. Once the project is big, the excess css will become more and more, resulting in larger and larger packages, thus affecting the performance of the project. Therefore, it is necessary to remove these redundant css in the formal environment. A library purgecss is recommended here, which supports CLI, JavascriptApi, Webpack and other ways. Through this library, We can easily get rid of the excess css.
Hello vanillared We use Parcel to bundle this sandbox, you can find more info about Parcelhere.body {font-family: sans-serif;} a {color: red;} ul {li {list-style: none;}} import Purgecss from "purgecss"; const purgecss = new Purgecss ({content: ["* / * .html"], css: ["* * / * .css"]}); const purgecssResult = purgecss.purge ()
The final purgecssResult result is as follows. You can see that the styles of the redundant an and ul tags are gone.
Thank you for reading this article carefully. I hope the article "how to remove redundant patterns of vue" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.