2
votes

I ran into an issue with a new build I am creating with gruntjs. I wanted to use grunt-contrib-copy to copy files into my deployment area and then reuse those destination files in a later task. It looks like I should be able to reference task destination files using a template as described in the Grunt: Configuring Tasks documentation. But when I use this with a file array format specified source task it does not work.

I have created a gist that shows the problem: Grunt File Array Example Gist

Reproduction:

  1. git clone https://gist.github.com/5065053.git test_example
  2. cd test_example
  3. npm install
  4. ./node_modules/.bin/grunt
  5. See how the output from debug_files tasks don't have files for dests of items specified with file array syntax.

It is likely that I am just doing something wrong, but I can't seem to track it down. Does anyone see my error?

1

1 Answers

0
votes

I think the templates simply cannot fetch values from arrays. I had a similar problem and worked around it by creating a standard JS variable in my Gruntfile (after all it's a standard JS file).

Still you may want to try: <%= concat.prod.files.0.dest %>, which I'm not able to try at the moment.