Skip to content

Instantly share code, notes, and snippets.

@michsch
Last active August 29, 2015 14:05
Show Gist options
  • Save michsch/dba1b94337735577ad33 to your computer and use it in GitHub Desktop.
Save michsch/dba1b94337735577ad33 to your computer and use it in GitHub Desktop.
Grunt configuration to copy CSS files and change the filename extension to SCSS.
/**
* http://gotofritz.net/blog/geekery/rename-files-while-copying-grunt/
*/
module.exports = function( grunt ) {
"use strict";
grunt.initConfig({
//copy all css files to sass directory, and rename to .scss
copy: {
getSCSSFromCSS: {
files: [
{
expand: true,
cwd: 'path/to/css/',
src: ['**/*.css'],
dest: 'path/to/sass/',
rename: function(dest, src) {
return dest + src.replace(/\.css$/, ".scss");
}
}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment