如何在 PhpStorm/WebStorm 中自动缩小 html 个文件?

How to automatically minify html files in PhpStorm/ WebStorm?

对于 CSS 文件,我创建了一个文件观察器,如 manual. Also for JS files, see manual 中所述,它们都使用 YUI Compressor

但我没有找到如何添加文件观察器,它会缩小 html 文件(例如删除评论,..)。如何使用 PhpStorm 自动缩小 html 个文件?

我建议查看 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 并使用 Grant/Gulp 控制台执行