@fullhuman/vue-cli-plugin-purgecss

中文文档
9.1.0发布于 2026/11/08MITCommonJS零依赖构建来源已验证近 30 天下载 6541

vue-cli plugin to add PurgeCSS

原始使用文档
文档目录5 节
  1. Install
  2. Usage
  3. Contributing
  4. Versioning
  5. License

vue-cli-plugin-purgecss

A Vue CLI 3 Plugin for installing PurgeCSS

Install

If you haven't yet installed vue-cli 3, first follow the install instructions here: https://github.com/vuejs/vue-cli

Generate a project using vue-cli 3.0:

vue create my-app

Before installing the PurgeCSS plugin, make sure to commit or stash your changes in case you need to revert the changes.

To install the PurgeCSS plugin simply navigate to your application folder and add PurgeCSS.

cd my-app

vue add @fullhuman/purgecss

Usage

Below are the PurgeCSS options set by this plugin:

{
  content: [ `./public/**/*.html`, `./src/**/*.vue` ],
  defaultExtractor (content) {
    const contentWithoutStyleBlocks = content.replace(/<style[^]+?<\/style>/gi, '')
    return contentWithoutStyleBlocks.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || []
  },
  safelist: [ /-(leave|enter|appear)(|-(to|from|active))$/, /^(?!(|.*?:)cursor-move).+-move$/, /^router-link(|-exact)-active$/, /data-v-.*/ ],
}

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

PurgeCSS use SemVer for versioning.

License

This project is licensed under the MIT License - see the LICENSE file for details.

版本与发布记录

@fullhuman/vue-cli-plugin-purgecss 共发布 19 个版本,首次发布于 2020/02/18;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
9.1.0latest2026/11/088 天前
9.0.02026/11/079 天前
8.0.02026/01/259 个月前
7.0.22024/11/222 年前
7.0.1-alpha.02024/11/212 年前
6.0.02024/03/302 年前

其他发布通道:next → 3.1.0-alpha.0。

关于 @fullhuman/vue-cli-plugin-purgecss 的常见问题

@fullhuman/vue-cli-plugin-purgecss 是什么?

vue-cli plugin to add PurgeCSS

如何安装 @fullhuman/vue-cli-plugin-purgecss?

在项目目录运行 npm install @fullhuman/vue-cli-plugin-purgecss,或使用 pnpm add / yarn add / bun add。

@fullhuman/vue-cli-plugin-purgecss 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fullhuman__vue-cli-plugin-purgecss 是否存在。

@fullhuman/vue-cli-plugin-purgecss 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@fullhuman/vue-cli-plugin-purgecss 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.12.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fullhuman/vue-cli-plugin-purgecss 可以商用吗?

@fullhuman/vue-cli-plugin-purgecss 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fullhuman/vue-cli-plugin-purgecss 的下载量有多少?

根据 npm 官方下载统计,@fullhuman/vue-cli-plugin-purgecss 在 2026/10/16 – 2026/11/14 这 30 天内被下载 6,541 次,日均约 218 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fullhuman/vue-cli-plugin-purgecss 还在维护吗?

最新版本 9.1.0 发布于 2026/11/08(8 天前);至今共发布 19 个版本,其中过去 12 个月发布了 3 个;首次发布于 2020/02/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。