Skip to content

Instantly share code, notes, and snippets.

@romuleald
Last active August 29, 2015 14:18
Show Gist options
  • Save romuleald/2e4b7b18834c58dc66c3 to your computer and use it in GitHub Desktop.
Save romuleald/2e4b7b18834c58dc66c3 to your computer and use it in GitHub Desktop.
Rename destination path in Grunt
grunt.initConfig({
less: {
development: {
files: [{
expand: true,
cwd: 'src/',
src: ['**/*.less'],
dest: 'css/',
ext: '.css',
rename: function(dest, src) {
//dest contain the 'css/' path
//dest will be the file processed like 'foo/bar/file.css'
return dest + src.replace('/bar', '');
}
}]
}
}
});
@romuleald
Copy link
Author

File:

"/src/foo/bar/file.less"

Will be processed in:

"/css/foo/file.css"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment