gruntjs / grunt-contrib-sass

Compile Sass to CSS.
http://gruntjs.com/
MIT License
848 stars 141 forks source link

lib/check.js doesn't support compass arg #245

Open much-rebel opened 6 years ago

much-rebel commented 6 years ago

This makes impossible to use sass.options.check=true if project uses compass.

If any of sass files will include like @import "compass/css3" it will fail with File to import not found or unreadable: compass/css3.

Applies to all versions of the package, all OSes.

Grunt sass config:

sass:

      options:
        check: true
        sourcemap: 'auto'
        compass: true
        quiet: true
        style: 'compressed'
        cacheLocation: '.sass-cache'

      website:
        options:
          loadPath:
            [
              '<%= paths.website.sass %>'
              'assets/3/lib'
            ]
        files:
          [
            expand:  yes
            cwd:     '<%= paths.website.sass %>'
            src:     [ '{,**/}*.scss', '{,**/}*.sass' ]
            dest:    '<%= paths.website.css %>'
            ext:     '.css'
          ]

Sass file causing problems:

@import compass/css3

// Evething is limited to this scope
.header
...

From verbose you can see it doesn't add compass arg to command:

/var/www/html# grunt --verbose sass
...
Checking file assets/3/sass/search/desktop.scss - failed.
Command: sass --check assets/3/sass/bootstrap.sass --load-path=assets/3/sass/ --load-path=assets/3/lib
...

Same command launched manually with compass arg gives no error:

/var/www/html# sass --compass --check assets/3/sass/bootstrap.sass --load-path=assets/3/sass/ --load-path=assets/3/lib
/var/www/html#