nDmitry / grunt-autoprefixer

Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.
MIT License
794 stars 60 forks source link

Fix grunt-autoprefixer blocking grunt when it finds no files #116

Closed 0xR closed 9 years ago

0xR commented 9 years ago

Fixes #115

nDmitry commented 9 years ago

Thanks but I already fixed this, so closing this one.

0xR commented 9 years ago

Yeah about that, it isn't fix. Your new code still assumes this.files is not empty. When it is empty the forEach loop is never called and done() is never called. My fix does fix it.

nDmitry commented 9 years ago

With what exactly config this.files can be empty?

I'm running grunt-autoprefixer with src property that maps nothing and get the following:

$ grunt autoprefixer
Running "autoprefixer:dist" (autoprefixer) task
>> No source files were found.

Done, without errors.
0xR commented 9 years ago
    autoprefixer: {
      options: {
        browsers: ['> 5%', 'last 2 version', 'ie >= 9']
      },
      dist: {
        files: [
          {
            expand: true,
            cwd: '.tmp/css/',
            src: '**/*.css',
            dest: '.tmp/css/'
          }
        ]
      }
    },
nDmitry commented 9 years ago

Ok, let's add this condition too.

nDmitry commented 9 years ago

Thanks for the help!