Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Replace doesn't work when using expand: true #20

Open
ProLoser opened this issue Feb 5, 2014 · 2 comments
Open

Replace doesn't work when using expand: true #20

ProLoser opened this issue Feb 5, 2014 · 2 comments
Labels

Comments

@ProLoser
Copy link

ProLoser commented Feb 5, 2014

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 pushed a commit to ProLoser/grunt-filerev that referenced this issue Feb 5, 2014
@iham
Copy link

iham commented Mar 21, 2014

works like a charm!

a big thank you to airtonix!

@soswow
Copy link

soswow commented May 14, 2014

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

@eddiemonge eddiemonge added the bug label Aug 7, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants