title: Yeoman/Grunt - Compiling SASS files in subfolder
body: <p>This is my folder structure:</p>
  
  <p><a href="https://i.stack.imgur.com/RuNqd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RuNqd.png" alt="enter image description here"></a></p>
  
  <p>All the <code>sass</code> files that are in the <code>styles</code> folder (e.g. <code>newStyles.sass</code>) are being compiled, but the <code>sass</code> files in the <code>myUi</code> folder (e.g. <code>nuclearMed.sass</code>) are not.</p>
  
  <p>I changed to <code>{,*/}*</code> with <code>/**/*</code> in my <code>Gruntfile.js</code>, but it is still only looking one-level down. Does anyone know what I am doing wrong?</p>
  
  <p>This is my <code>Gruntfile.js</code></p>
  
  <pre><code>// Generated on 2013-08-28 using generator-webapp 0.4.1
  'use strict';
  var LIVERELOAD_PORT = 35729;
  var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
  var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
  };
  
  // # Globbing
  // for performance reasons we're only matching one level down:
  // 'test/spec/**/*.js'
  // use this if you want to recursively match all subfolders:
  // 'test/spec/**/*.js'
  
  module.exports = function (grunt) {
    // show elapsed time at the end
    require('time-grunt')(grunt);
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);
  
    // configurable paths
    var yeomanConfig = {
      app: 'app',
      dist: 'dist'
    };
  
    grunt.initConfig({
      yeoman: yeomanConfig,
      watch: {
        coffee: {
          files: ['&lt;%= yeoman.app %&gt;/scripts/**/*.coffee'],
          tasks: ['coffee:dist']
        },
        coffeeTest: {
          files: ['test/spec/**/*.coffee'],
          tasks: ['coffee:test']
        },
        compass: {
          files: ['&lt;%= yeoman.app %&gt;/styles/**/*.{scss,sass}'],
          tasks: ['compass:server', 'autoprefixer']
        },
        styles: {
          files: ['&lt;%= yeoman.app %&gt;/styles/**/*.css'],
          tasks: ['copy:styles', 'autoprefixer']
        },
        jade: {
          files: ['&lt;%= yeoman.app %&gt;/**/*.jade'],
          tasks: ['jade']
        },
        livereload: {
          options: {
            livereload: LIVERELOAD_PORT
          },
          files: [
            '.tmp/**/*.html',
            '&lt;%= yeoman.app %&gt;/**/*.sass',
            '.tmp/styles/**/*.css',
            '{.tmp,&lt;%= yeoman.app %&gt;}/scripts/**/*.js',
            '&lt;%= yeoman.app %&gt;/images/**/*.{png,jpg,jpeg,gif,webp,svg}'
          ]
        }
      },
      connect: {
        options: {
          port: 9000,
          // change this to '0.0.0.0' to access the server from outside
          hostname: 'localhost'
        },
        livereload: {
          options: {
            middleware: function (connect) {
              return [
                lrSnippet,
                mountFolder(connect, '.tmp'),
                mountFolder(connect, yeomanConfig.app)
              ];
            }
          }
        },
        test: {
          options: {
            middleware: function (connect) {
              return [
                mountFolder(connect, '.tmp'),
                mountFolder(connect, 'test'),
                mountFolder(connect, yeomanConfig.app)
              ];
            }
          }
        },
        dist: {
          options: {
            middleware: function (connect) {
              return [
                mountFolder(connect, yeomanConfig.dist)
              ];
            }
          }
        }
      },
      open: {
        server: {
          path: 'http://localhost:&lt;%= connect.options.port %&gt;'
        }
      },
      jade: {
        dist: {
          options: {
            pretty: true
          },
          files: [{
            expand: true,
            cwd: '&lt;%= yeoman.app %&gt;',
            dest: '.tmp',
            src: '*.jade',
            ext: '.html'
          }]
        }
      },
      clean: {
        dist: {
          files: [{
            dot: true,
            src: [
              '.tmp',
              '&lt;%= yeoman.dist %&gt;/*',
              '!&lt;%= yeoman.dist %&gt;/.git*'
            ]
          }]
        },
        server: '.tmp'
      },
      jshint: {
        options: {
          jshintrc: '.jshintrc'
        },
        all: [
          'Gruntfile.js',
          '&lt;%= yeoman.app %&gt;/scripts/**/*.js',
          '!&lt;%= yeoman.app %&gt;/scripts/vendor/*',
          'test/spec/**/*.js'
        ]
      },
      mocha: {
        all: {
          options: {
            run: true,
            urls: ['http://localhost:&lt;%= connect.options.port %&gt;/index.html']
          }
        }
      },
      coffee: {
        dist: {
          files: [{
            expand: true,
            cwd: '&lt;%= yeoman.app %&gt;/scripts',
            src: '**/*.coffee',
            dest: '.tmp/scripts',
            ext: '.js'
          }]
        },
        test: {
          files: [{
            expand: true,
            cwd: 'test/spec',
            src: '**/*.coffee',
            dest: '.tmp/spec',
            ext: '.js'
          }]
        }
      },
      compass: {
        options: {
          sassDir: '&lt;%= yeoman.app %&gt;/styles/**/*.js',
          cssDir: '.tmp/styles',
          generatedImagesDir: '.tmp/images/generated',
          imagesDir: '&lt;%= yeoman.app %&gt;/images',
          javascriptsDir: '&lt;%= yeoman.app %&gt;/scripts',
          fontsDir: '&lt;%= yeoman.app %&gt;/styles/fonts',
          importPath: '&lt;%= yeoman.app %&gt;/bower_components',
          httpImagesPath: '/images',
          httpGeneratedImagesPath: '/images/generated',
          httpFontsPath: '/styles/fonts',
          relativeAssets: false
        },
        dist: {
          options: {
            generatedImagesDir: '&lt;%= yeoman.dist %&gt;/images/generated'
          }
        },
        server: {
          options: {
            debugInfo: true
          }
        }
      },
      autoprefixer: {
        options: {
          browsers: ['last 1 version']
        },
        dist: {
          files: [{
            expand: true,
            cwd: '.tmp/styles/',
            src: '**/*.css',
            dest: '.tmp/styles/'
          }]
        }
      },
      // not used since Uglify task does concat,
      // but still available if needed
      /*concat: {
        dist: {}
      },*/
      'bower-install': {
        app: {
          html: '&lt;%= yeoman.app %&gt;/index.html',
          ignorePath: '&lt;%= yeoman.app %&gt;/'
        }
      },
      // not enabled since usemin task does concat and uglify
      // check index.html to edit your build targets
      // enable this task if you prefer defining your build targets here
      /*uglify: {
        dist: {}
      },*/
      rev: {
        dist: {
          files: {
            src: [
              '&lt;%= yeoman.dist %&gt;/scripts/**/*.js',
              '&lt;%= yeoman.dist %&gt;/styles/**/*.css',
              '&lt;%= yeoman.dist %&gt;/images/**/*.{png,jpg,jpeg,gif,webp}',
              '&lt;%= yeoman.dist %&gt;/styles/fonts/**/*.*'
            ]
          }
        }
      },
      useminPrepare: {
        options: {
          dest: '&lt;%= yeoman.dist %&gt;'
        },
        html: '.tmp/index.html'
      },
      usemin: {
        options: {
          dirs: ['&lt;%= yeoman.dist %&gt;']
        },
        html: ['&lt;%= yeoman.dist %&gt;/**/*.html'],
        css: ['&lt;%= yeoman.dist %&gt;/styles/**/*.css']
      },
      imagemin: {
        dist: {
          files: [{
            expand: true,
            cwd: '&lt;%= yeoman.app %&gt;/images',
            src: '**/*.{png,jpg,jpeg}',
            dest: '&lt;%= yeoman.dist %&gt;/images'
          }]
        }
      },
      svgmin: {
        dist: {
          files: [{
            expand: true,
            cwd: '&lt;%= yeoman.app %&gt;/images',
            src: '**/*.svg',
            dest: '&lt;%= yeoman.dist %&gt;/images'
          }]
        }
      },
      htmlmin: {
        dist: {
          files: [{
            expand: true,
            cwd: '.tmp',
            src: '*.html',
            dest: '&lt;%= yeoman.dist %&gt;'
          }]
        }
      },
      // Put files not handled in other tasks here
      copy: {
        dist: {
          files: [{
            expand: true,
            dot: true,
            cwd: '&lt;%= yeoman.app %&gt;',
            dest: '&lt;%= yeoman.dist %&gt;',
            src: [
              '*.{ico,png,txt}',
              '.htaccess',
              'images/**/*.{webp,gif}',
              'styles/fonts/**/*.*'
            ]
          }]
        },
        styles: {
          expand: true,
          dot: true,
          cwd: '&lt;%= yeoman.app %&gt;/styles',
          dest: '.tmp/styles/',
          src: '**/*.css'
        }
      },
      concurrent: {
        server: [
          'compass',
          'jade',
          'coffee:dist',
          'copy:styles'
        ],
        test: [
          'coffee',
          'copy:styles'
        ],
        dist: [
          'coffee',
          'compass',
          'copy:styles',
          'imagemin',
          'svgmin',
          'htmlmin'
        ]
      }
    });
  
    grunt.registerTask('server', function (target) {
      if (target === 'dist') {
        return grunt.task.run(['build', 'open', 'connect:dist:keepalive']);
      }
  
      grunt.task.run([
        'clean:server',
        'concurrent:server',
        'autoprefixer',
        'connect:livereload',
        'open',
        'watch'
      ]);
    });
  
    grunt.registerTask('test', [
      'clean:server',
      'concurrent:test',
      'autoprefixer',
      'connect:test',
      'mocha'
    ]);
  
    grunt.registerTask('build', [
      'clean:dist',
      'jade',
      'useminPrepare',
      'concurrent:dist',
      'autoprefixer',
      'concat',
      'cssmin',
      'uglify',
      'copy:dist',
      'rev',
      'usemin'
    ]);
  
    grunt.registerTask('default', [
      'jshint',
      'test',
      'build'
    ]);
  };
  </code></pre>