grunt-filerev
grunt-filerev copied to clipboard
Replace doesn't work when using expand: true
So this is my config:
// Renames files for browser caching purposes
filerev: {
dist: {
expand: true,
cwd: '<%= yeoman.dist %>',
src: [
'script/**/*.js',
'style/**/*.css',
'img/**/*.{png,jpg,jpeg,gif,webp,svg}',
'font/**/*.ttf'
]
}
},
Unfortunately, leaving out the dest doesn't trigger the 'replace' behavior and also places all my output files in the root of my project.
Do you think you could add the option to explicitly enable replacement?
works like a charm!
a big thank you to airtonix!
In there are folks like me who is waiting for this, here is workaround:
Instead of this:
filerev:
dist:
expand: true
src: [
"<%= yeoman.dist %>/scripts/{,**/}*.js"
"<%= yeoman.dist %>/styles/{,*/}*.css"
"<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}"
"<%= yeoman.dist %>/fonts/*"
]
you can do this:
filerev:
scripts: src: "<%= yeoman.dist %>/scripts/{,**/}*.js"
styles: src: "<%= yeoman.dist %>/styles/{,*/}*.css"
images: src: "<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}"
fonts: src: "<%= yeoman.dist %>/fonts/*"