Skip to content

Instantly share code, notes, and snippets.

@jakefentress
Created August 2, 2016 21:15
Show Gist options
  • Save jakefentress/942d4749792be9f38de4dfd213aa85b7 to your computer and use it in GitHub Desktop.
Save jakefentress/942d4749792be9f38de4dfd213aa85b7 to your computer and use it in GitHub Desktop.
Renaming in Grunt - also works to move a file to a directory related to file name
```
files: [
{
expand: true,
cwd: 'branding/',
src: ['**/*.scss'],
dest: 'branding/',
ext: '.css',
rename: function(dest, src) { return (dest + src).replace('scss', 'css'); }
},
{
expand: true,
cwd: 'scss',
src: '*.scss',
dest: 'css',
ext: '.css'
}
]
```
`rename` is the magic part here. It takes the destination and source names and lets you modify them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment