grunt-uncss icon indicating copy to clipboard operation
grunt-uncss copied to clipboard

file.src should be file.orig.src (grunt 1.0.1)

Open ffflabs opened this issue 7 years ago • 0 comments

I've seen that src filepaths are referenced using file.src

https://github.com/addyosmani/grunt-uncss/blob/f2c24ca17a8e6a4e114fb03f50ec605c0d986594/tasks/uncss.js#L22-L23

However, if I use a config such as:

grunt.config('custom_uncss', {
    test: {
      files: {
        'dist/css/tidy.css': ['http://localhost:9003/']
      }
    }
});

logging the contents of file I get:

{ 
  src: [Getter],
  dest: 'dist/css/tidy.css',
  orig: { 
    src: [ 'http://localhost:9003/' ], 
    dest: 'dist/css/tidy.css' 
  }
}

file.src turns out to be an empty array, whereas file.orig.src contains the array of filepaths I intended to be the sources.

Perhaps there could be a check setting the sources to be the contents of file.orig.src when file.src turns out to be empty.

ffflabs avatar Feb 02 '18 15:02 ffflabs