MIT License

项目介绍

FullHuman/purgecss 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,采用 MIT License 许可证,目前获得 8.1k 个 Star、246 次 Fork。

仓库全名
FullHuman/purgecss
开源许可证
MIT License
Star 数
8.1k
Fork 数
246
未关闭 Issue
14

README 摘要

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 css files with the ones in…

完整内容见 GitHub 原始 README 或本页 。

常见问题

purgecss 用什么语言开发?

主要使用 TypeScript 编写,采用 MIT License 许可证,目前有 8.1k 个 Star。

purgecss 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 purgecss 的源码?

可以直接克隆仓库:git clone https://github.com/FullHuman/purgecss.git,默认分支为 main;安装与运行步骤见仓库 README。

purgecss 最近还在维护吗?

仓库最近一次更新为 21 小时前,当前有 14 个未关闭 Issue;Star 数为 8.1k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Remove unused CSS

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
8597
价值分
4909
活跃状态
活跃

语言占比

CSS
HTML
JavaScript
Stylus
TypeScript

Release

README

PurgeCSS

npm npm GitHub Dependabot

PurgeCSS logo

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 css files with the ones in your content files. It removes unused selectors from your css, resulting in smaller css files.

You can try PurgeCSS online at purgecss.full-human.com.

Sponsors 🥰

Documentation

You can find the PurgeCSS documentation on this website.

Table of Contents

PurgeCSS
Plugins
Guides

Getting Started

Installation

PurgeCSS requires Node.js 22.12 or later.

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 pnpm workspaces and Changesets. That means that we actually publish several packages to npm from the same codebase, including:

Package Version Description
purgecss npm The core of PurgeCSS
postcss-purgecss npm (scoped) PostCSS plugin for PurgeCSS
purgecss-webpack-plugin npm Webpack plugin for PurgeCSS
gulp-purgecss npm Gulp plugin for PurgeCSS
grunt-purgecss npm Grunt plugin for PurgeCSS
rollup-plugin-purgecss npm Rollup plugin for PurgeCSS
purgecss-from-html npm Html extractor for PurgeCSS
purgecss-from-pug npm Pug extractor for PurgeCSS
purgecss-with-wordpress npm Collection of safelist items for WordPress
vue-cli-plugin-purgecss npm Vue CLI Plugin for PurgeCSS

评论

暂无评论