- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/FullHuman/purgecss
- 软件文档: https://github.com/FullHuman/purgecss/blob/master/README.md
- 官方下载: https://github.com/FullHuman/purgecss
软件介绍
当你建立一个网站的时候,你可能会大量使用像Bootstrap,Materializecss,Foundation这样的框架,但是你只会使用其中的一小部分,而且这部分还包括了大量的多余的CSS样式。Purgecss起作用了,Purgecss会分析你的内容和你的css文件。然后将文件中使用的选择器与内容文件中的选择器相匹配。再从CSS中删除未使用的选择器,是的css文件变得更小。
入门:
安装
npm i --save-dev purgecss
使用
import Purgecss from 'purgecss'
const purgeCss = new Purgecss({
content: ['**/*.html'],
css: ['**/*.css']
})
const result = purgecss.purge()使用自定义提取器:
import Purgecss from 'purgecss'
import purgeHtml from 'purge-from-html'
const purgeCss = new Purgecss({
content: ['**/*.html'],
css: ['**/*.css'],
extractors: [
{
extractor: purgeHtml,
extensions: ['html']
}
]
})
const result = purgecss.purge()
Rework
Jason Fried、David Heinemeier Hansson / Crown Business / 2010-3-9 / USD 22.00
"Jason Fried and David Hansson follow their own advice in REWORK, laying bare the surprising philosophies at the core of 37signals' success and inspiring us to put them into practice. There's no jarg......一起来看看 《Rework》 这本书的介绍吧!
