grunt-filerev icon indicating copy to clipboard operation
grunt-filerev copied to clipboard

Replace doesn't work when using expand: true

Open ProLoser opened this issue 11 years ago • 2 comments

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?

ProLoser avatar Feb 05 '14 21:02 ProLoser

works like a charm!

a big thank you to airtonix!

iham avatar Mar 21 '14 11:03 iham

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/*"

soswow avatar May 14 '14 19:05 soswow