有没有专门用于缩小内联 css 的 grunt 插件?我正在使用 grunt-critical 来注入(inject)内联 css。是否有任何 grunt 插件可以缩小 1 个文件夹中所有 html 文件的内联 css?我试过 grunt-htmlprocessor,它只是为了缩小 html 代码。
最佳答案
Minify 是一个默认设置为 false 的选项。您可以看到选项的完整列表 here
// example from https://www.npmjs.com/package/grunt-critical
critical: {
test: {
options: {
base: './',
css: [
'test/fixture/styles/main.css',
'test/fixture/styles/bootstrap.css'
],
minify:true,
width: 320,
height: 70
},
src: 'test/fixture/index.html',
dest: 'test/generated/index-critical.html'
}
}
关于javascript - Grunt 缩小内联 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35086368/