我是新来的咕噜咕噜的探索者。必须说它是一个很好的工具,成功地将它用于css-uglify和js-uglify。
现在我正在尝试学习需要css文件的un-css和用于解析phantom-js的url,我有大约242个网址。当我运行grunt命令时,它运行一段时间然后给出错误,如
evaluating open() call: Error: connect ECONNREFUSED
这就是我读取数组中所有网址的方式
var _getAllFilesFromFolder = function(dir) {
var filesystem = require("fs");
var results = [];
filesystem.readdirSync(dir).forEach(function(file) {
file = dir + '/' + file;
var stat = filesystem.statSync(file);
results.push('http://p1.localcdomain.in/' + file);
});
return results;
};
var htmlPhpFileAll = _getAllFilesFromFolder("themes/html");
这是我的咕噜文件
module.exports = function(grunt) {
grunt.initConfig({
uncss: {
in_css: {
options: {
stylesheets: [
'../../themes/ngCus/source/js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.css',
'../../themes/ngCus/source/css/bootstrap-multiselect.css',
'../../themes/ngCus/source/css/font-icons/font-awesome/css/font-awesome.min.css',
'../../themes/ngCus/source/js/selectboxit/jquery.selectBoxIt.css',
'../../themes/ngCus/source/js/select2/select2.css',
'../../themes/ngCus/source/js/daterangepicker/daterangepicker-bs3.css',
'../../themes/ngCus/source/css/stylesheet.css',
'../../themes/ngCus/source/css/toaster.css',
'../../themes/ngCus/source/js/select/fancyfields.css',
'../../themes/ngCus/source/js/morris/morris-0.4.3.min.css',
'../../themes/ngCus/source/css/tabbed.css',
'../../themes/ngCus/source/css/contextmenu.css',
'../../themes/ngCus/source/css/font-icons/entypo/css/entypo.css'
],
report: 'min',
urls: htmlPhpFile,
},
files: {
'themes/ngCus/source/css/app.clean.css': [
'themes/html/*.php',
]
}
},
});
grunt.loadNpmTasks('grunt-uncss');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-concat-css');
grunt.loadNpmTasks('grunt-contrib-cssmin');
//grunt.loadNpmTasks('grunt-contrib-requirejs');
// grunt.registerTask('default', ["uglify:dist"]);
}