GitHub - FullHuman/purgecss: Remove unused css
source link: https://github.com/FullHuman/purgecss
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
PurgeCSS
What is PurgeCSS?
When you are building a website, chances are that you are using a css framework like Bootstrap, Materializecss, Foundation, etc... But you will only use a small set of the framework and a lot of unused css styles will be included.
This is where PurgeCSS comes into play. PurgeCSS analyzes your content and your css files. Then it matches the selectors used in your files with the one in your content files. It removes unused selectors from your css, resulting in smaller css files.
Sponsors
Documentation
You can find the PurgeCSS documentation on this website.
Table of Contents
PurgeCSS
Plugins
Guides
Getting Started
Installation
npm install purgecss --save-dev
Usage
import { PurgeCSS } from "purgecss";
const purgeCSSResults = await new PurgeCSS().purge({
content: ["**/*.html"],
css: ["**/*.css"],
});
Packages
This repository is a monorepo that we manage using Lerna. That means that we actually publish several packages to npm from the same codebase, including:
Package | Version | Description |
---|---|---|
purgecss | The core of PurgeCSS | |
postcss-purgecss | PostCSS plugin for PurgeCSS | |
purgecss-webpack-plugin | Webpack plugin for PurgeCSS | |
gulp-purgecss | Gulp plugin for PurgeCSS | |
grunt-purgecss | Grunt plugin for PurgeCSS | |
rollup-plugin-purgecss | Rollup plugin for PurgeCSS | |
purgecss-from-html | Html extractor for PurgeCSS | |
purgecss-from-pug | Pug extractor for PurgeCSS | |
purgecss-with-wordpress | Collection of safelist items for WordPress | |
vue-cli-plugin-purgecss | Vue CLI Plugin for PurgeCSS |
Recommend
-
33
原文地址:Measure runtime performance in Vue apps 原文作者:Alex Jover 译者:程序猿何大叔 特别声明:本文是作者 Alex Jover 发布在 VueDose 上的一个系列。 版权归作者所有。 译者在翻译
-
34
README.md Tosin
-
27
How to remove unused CSS to reduce your app’s bundle size and maintain a clear and simple code.
-
8
开源日报 开源日报第968期:《笔记 takenote》 2020-12-03 99 0...
-
2
Configure PurgeCss to not remove certain styles 4 days ago, no comments yet, Barry van Veen If you...
-
4
Closed Bug 1706436 Opened 25 days ago Closed 24 days ago...
-
7
How to remove unused JS and CSS with the Coverage tab from Dev Tools These days a lot of my day-to-day work was centered around the loading speed of our pages. And a big bottleneck was unused code. We were serving too much...
-
3
Closed Bug 1732695 Opened 2 months ago Closed 23 days ago...
-
3
Copy link Member Smjert commented...
-
1
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK