vue-cli-plugin-purgers (英语)
A 类 Vue CLI 3 插件 用于安装PurgeCSS
安装
如果您还没有安装 vue-cli 3, 请先在此遵循安装指令 : https://github.com/vuejs/vue-cli (中文(简体) )
使用 vue- cli 3. 0 创建项目 :
vue create my-app
在安装 PurgeCSS 插件之前, 请保证执行或隐藏您的更改, 以防您需要还原这些更改 .
要安装 PurgeCSS 插件, 只需在您的应用程序文件夹中导航并添加 PurgeCSS .
cd my-app
vue add @fullhuman/purgecss
使用量
以下是此插件设置的 PurgeCSS 选项 :
{
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-.*/ ],
}
捐款
请阅读 捐款额 关于我们代码的细节
以及向我们提交拉动请求的程序.
版本
清洗系统使用情况 交换器 用于版本.
许可证
这个项目根据麻省理工学院许可证颁发——见 自由主义 文件
详细情况.
关于 @fullhuman/vue-cli-plugin-purgecss 的常见问题
@fullhuman/vue-cli-plugin-purgecss 是什么?
添加 PurgeCSS 的 vue- cli 插件
如何安装 @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 和提交记录判断。