尝试使用grunt uncss删除一些CSS

我有一个网站,我用几个巨大的css文件inheritance,用Firefox中的DUst-Me Selector进行分析,返回了我近2000个未使用的样式。

要删除它们,我正在尝试使用grunt uncss,问题是我得到以下错误:

grunt uncss Running "uncss:dist" (uncss) task Fatal error: uncss/node_modules/css: missing '}' near line 2429:5 -> .mobile-hidden { 

这些是我的configuration文件

的package.json

 { "name": "tappr-registration", "version": "0.1.0", "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-copy": "^0.7.0", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-nodeunit": "~0.4.1", "grunt-contrib-uglify": "^0.6.0", "grunt-processhtml": "^0.3.3", "grunt-uncss": "^0.3.7" } } 

Gruntfile.js

 module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uncss: { dist: { options: { media: ['min-width'], timeout: 1000, htmlroot: 'public_html', report: 'max' }, files: { 'dist/clean.css': ['public_html/index.php', 'public_html/page_2.html', 'public_html/page_3.html'] } } } }); // Load the plugin that provides the "uncss" task. grunt.loadNpmTasks('grunt-uncss'); grunt.loadNpmTasks('grunt-processhtml'); grunt.registerTask('default', ['uncss','processhtml']); }; 

现在,我最好的猜测是,我得到这个错误,因为我指定了错误的方式媒体查询包括,但我还没有find一些体面的文件,如何uncss希望这个选项。

我已经试图取消选项。

有人有一些好的build议吗?

相信与否这个问题是由评论造成的:

 <!-- ----- Responsive 34.2857142857em ------> 

之后,我删除他们一切正常,我可以说这是非常需要的。

 Running "uncss:dist" (uncss) task File cleancss/tidy.css created: 229.48 kB → 25.98 kB 

🙂