我尝试使用 grunt 配置 uncss
我已经安装
npm install grunt-uncss --save-dev
npm install grunt-processhtml --save-dev
配置
uncss: {
dist: {
files: { 'dist/css/clean.css': ['index.php'] }
}
}
最后,我将它们加载并注册一个默认任务,如下所示:
grunt.loadNpmTasks('grunt-uncss');
grunt.loadNpmTasks('grunt-processhtml');
grunt.registerTask('default', ['uncss', 'processhtml']);
结果
当我跑grunt
最后我一直看到:
运行“uncss:dist”(uncss)任务
致命错误:PhantomJS:无法打开关于:空白
更新
我补充说:
processhtml: {
dist: {
files: {
'index.php': ['index.php']
}
}
}
运行后仍然报同样的错误grunt