-1

Related to: https://stackoverflow.com/a/15371443/510045

I am trying to configure grunt to dynamically compile my .scss files using grunt-sass. I'd like to compile only non-partial files but am running into an issue where if the filename has more than one dot in it, the compiled css filename is incomplete. Here is my configuration:

sass: {
    dist: {
        files: [{
            expand: true, // Enable dynamic expansion.
            cwd: 'sass/', // Src matches are relative to this path.
            src: ['**/*.scss', '!**/_*.scss'], // Actual pattern(s) to match. Compile all .scss files except partials
            dest: 'css', // Destination path prefix.
            ext: '.css', // Dest filepaths will have this extension.
        }]
    }
}

This works as expected except for those aforementioned multiple dot filenames. For example, a file named some.jquery.plugin.scss will get compiled to a file named some.css instead of some.jquery.plugin.css.

I've been digging around the grunt documentation on files format but am not having any luck. Thanks in advance!

Community
  • 1
  • 1
ErikPhipps
  • 155
  • 1
  • 3
  • 12
  • possible duplicate of [Configure Grunt File Name Matching for Files with Multiple Dots](http://stackoverflow.com/questions/16697344/configure-grunt-file-name-matching-for-files-with-multiple-dots) – Sindre Sorhus Jun 08 '14 at 19:02

1 Answers1

1

More of a work around then answer for grunt-sass but if you use grunt-contrib-compass it allows for dots in the naming convention without any issues.

https://github.com/gruntjs/grunt-contrib-compass

You should already have ruby installed if you are using sass so shouldn't be a big effort to try and for the most part the configuration isn't that different.

Also might be worth trying https://github.com/gruntjs/grunt-contrib-sass it's possible they've solved for this.

bribou
  • 792
  • 6
  • 9
  • 1
    Thanks for the answer. Unfortunately the startup I was building this for ran out of funding so I won't be working on this anymore (at least not until the next time I use a Grunt workflow). I've accepted your answer as it offers some good alternatives. – ErikPhipps Feb 07 '14 at 16:31