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

Bad dest added when using targets #16

Open
erykwalder opened this issue Jan 17, 2014 · 1 comment
Open

Bad dest added when using targets #16

erykwalder opened this issue Jan 17, 2014 · 1 comment
Labels

Comments

@erykwalder
Copy link

I had a config that looked like this:

filerev: {
  options: {
    encoding: 'utf8',
    algorithm: 'md5',
    length: 8
  },
  files: {
    src: [
           '.tmp/build/images/**/*.*',
           '.tmp/build/sounds/**/*.*',
           '.tmp/build/app.css',
           '.tmp/build/app.js'
         ]
  }
}

Which, at the time, did exactly what I wanted. The files were simply replaced in their current directory.

I realized that when I updated images that were referred to in the css/js files, that was not accounted for in their version. So I used targets and separated out the config:

filerev: {
  options: {
    encoding: 'utf8',
    algorithm: 'md5',
    length: 8
  },
  media: {
    files: {
      src: [
             '.tmp/build/images/**/*.*',
             '.tmp/build/sounds/**/*.*'
           ]
    }
  },
  sources: {
    files: {
      src: [
             '.tmp/build/app.css',
             '.tmp/build/app.js'
           ]
    }
  }
}

I switched my compilation to use both. However, now the files were being renamed and put in the "src" directory.

@blowback
Copy link

You've used 'file object format' ("...where the property name is the destination file...") - that's why your stuff is going in a 'src' folder. you want 'file array format':

files: [
    {
        src: [
            // etc
        ]
        // implicit dest
    }
]

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

3 participants