如何自动缩小PhpStorm/WebStorm中的html文件? [英] How to automatically minify html files in PhpStorm/ WebStorm?

查看:83
本文介绍了如何自动缩小PhpStorm/WebStorm中的html文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于CSS文件,我已经创建了一个文件监控器,如本手册中所述.另请参阅手册,它们均使用YUI压缩器

For CSS files I have created a file watcher like described in this manual. Also for JS files, see manual, which both uses the YUI Compressor

但是我没有找到如何添加文件查看器,以最小化html文件(例如,删除注释,..).如何使用PhpStorm自动缩小html文件?

But I didn't find how to add file watchers, which minify html files (e.g. removing comments, ..). How can I automatically minify html files with PhpStorm?

推荐答案

我建议您查看 HTMLMinifier -具有CLI,因此可以将其设置为文件监视程序,也可以将其配置为 Grunt任务 Gulp任务,并使用Grant/Gulp控制台执行

I'd suggest looking at HTMLMinifier - it has CLI and thus can be set up as a file watcher, also it can be configured as Grunt task or Gulp task and executed using Grant/Gulp console

这篇关于如何自动缩小PhpStorm/WebStorm中的html文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆