andismith / grunt-responsive-images

Produce images at different sizes for responsive websites.
http://www.andismith.com/grunt-responsive-images/
MIT License
718 stars 96 forks source link

Unable to compile; no valid source files were found. #123

Closed ehvs closed 7 years ago

ehvs commented 7 years ago

Expected Behaviour

Use the plugin

Actual Behaviour

Running "responsive_images:dev" (responsive_images) task Unable to compile; no valid source files were found. Unable to compile; no valid source files were found.

Steps to Reproduce

Run $ grunt

PC/Mac and Graphics Engine used

LInux Mint GraphicsImage ImagesMagick

Grunt Configuration

Gruntfile.js

module.exports = function(grunt) {
grunt.initConfig({
responsive_images: {
  dev: {
    options: {
      engine: 'im',
      sizes: [{
        name: 'small',
        width: '30%',
        suffix: '_small',
        quality: 20
      },{
        name: 'large',
        width: '50%',
        suffix: '_large',
        quality: 40
      }]
    },
    files: [{
      expand: true,
      src: ['*.{gif,jpg,png}'],
      cwd: 'images/',
      dest: 'images/'
    }]
  }
},
});
grunt.loadNpmTasks('grunt-responsive-images');
grunt.registerTask('default', ['responsive_images']);
};

package.json

{
"name": "project-server",
"version": "0.1.0",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-uglify": "~0.5.0",
"grunt-responsive-images": "^1.10.1"
}}
ehvs commented 7 years ago

So,

 src: ['*.{gif,jpg,png}'],
      cwd: 'images/',
      dest: 'images/'

Attention to cwd value, it says that my current directory is /images, so whenever he tries to find the value for src, it will search under /images. BUT my files {.png,.jpeg} arent under /images.

Then, all I had to do was to comment the cwd value. And it worked fine!