andismith / grunt-responsive-images

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

Unable to compile; no valid source files were found #100

Closed idkjs closed 8 years ago

idkjs commented 8 years ago

Hi Folks,

I believe I have properly installed Grunt and its dependencies(though I may not have)

When i run grunt in my project folder, I am getting the following error regarding not finding files in the source folder. The path seems properly formatted to me. Anything standout to you? Thank you. ,,,

Kaona (master *) kaona.github.io $ grunt
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.

Done, without errors.

,,,

My Gruntfile.js file is in the project folder root same as package.json. This is my Gruntfile:

'use strict';

module.exports = function(grunt) {

  grunt.initConfig({
    responsive_images: {
      dev: {
        options: {
          sizes: [{
            name: 'small',
            width: '30%',
            suffix: '_small',
            quality: 20
          },{
            name: 'large',
            upscale:true,
            width: '50%',
            suffix: '_large',
            quality: 40
          }]
        },
        files: [{
          expand: true,
          src: ['img/**.{gif,jpg,png}'],
          cwd: 'images/',
          dest: 'images/'
        }]
      }
    },
  });

  grunt.loadNpmTasks('grunt-responsive-images');
  grunt.registerTask('default', ['responsive_images']);

};
,,,

package.json is in same project root directory and follows here in part:

 {
  "name": "kaona.github.io",
  "version": "1.0.0",
  "description": "udacity project 4",
  "main": "gruntfile.js",
  "dependencies": {
    "grunt": "^0.4.5",
    "grunt-responsive-images": "^0.1.7"
  },
  "devDependencies": {
    "grunt-responsive-images": "^0.1.7"
  },

Source files are here: screen shot 2015-10-31 at 10 06 56

andismith commented 8 years ago

You have cwd as 'images/' but there is no images folder as far as I can see.

mau-ferrusca commented 8 years ago

What are the differences between "cwd" and "src", then?

andismith commented 8 years ago

Any path in cwd is not appended to the dist path. Any path in src is appended to the dist path, and the src path is relative to the cwd path.

More info: http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically

mau-ferrusca commented 8 years ago

Excellent. I had not reached that part of the documentation. Only question that remains is what does "cwd" stand for?

Thanks, Andi.

andismith commented 8 years ago

Current Working Directory

Can I close this issue now please?

mau-ferrusca commented 8 years ago

By all means, thank you.

On Mon, Dec 7, 2015 at 9:41 AM, Andi Smith notifications@github.com wrote:

Current Working Directory

Can I close this issue now please?

— Reply to this email directly or view it on GitHub https://github.com/andismith/grunt-responsive-images/issues/100#issuecomment-162561601 .

Front End Senior Web Developer https://mx.linkedin.com/in/mauricioferrusca

HTML5, CSS, jQuery, Javascript

Co-Founder at codificARTE http://codificarte.com.mx

Twitter: @MauFerrusca

andismith commented 8 years ago

You're welcome :)