Skip to content

Instantly share code, notes, and snippets.

@mattacular
Created June 23, 2013 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattacular/5844063 to your computer and use it in GitHub Desktop.
Save mattacular/5844063 to your computer and use it in GitHub Desktop.
Grunt pattern to name dest after source
'sass': {
dist: {
// this pattern will recurse through Grunt project directory and look for folders called 'sass'
// it then looks inside the 'sass' folder for any files with extensive '*.scss' and converts them
// to a CSS file named the same except located in '../css/*.css'
files: grunt.file.expandMapping(['**/sass/*.scss'], 'css', {
rename: function (dest, matched) {
return matched.replace(/\/sass\//, '/' + dest + '/').replace(/\.scss$/, '.css');
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment