gruntjsgrunt-contrib-watchgrunt-contrib-compass

Grunt-compass can't compile multiple files


This is my Gruntfile.js(part of it) that has the code for compass directories as you can see bellow :

 compass: {
      dist: {
        options: {
        sassDir: '*/docs/scss/*.scss',
         cssDir: '*/css/*.css',
         outputStyle: 'compressed'
        }
      }
    },

I'm using grunt-newer to compile only recently edited elements in project folders.

Bluntly put i have two projects folders in my main development folder, and when i run grunt watch or grunt compass i want to compile the sass that has the newest changes in it so i can work on multiple project in the same time . I ve tried some stuff but i only get this :

You must compile individual stylesheets from the project directory .

Is there a way to work around this ?

I want to work with app1 (folder) app2 app3 and app4 and when i run grunt compass the compiler to check all files and to modify only the ones that have changes in them .


Solution

  • In the configuration you provided both sassDir and cssDir were not specified as directory strings as they also included file extensions.

    sassDir expects as string that points to the source directory where you keep your Sass stylesheets.

    cssDir expects a string that points to the target directory where you keep your CSS stylesheets.

    Thus a first step would be to revisit the entire set of instructions for how to specify the configuration.