Mutilple files not working #22

Closed
dilipkrish opened this Issue Mar 13, 2013 · 2 comments

Projects

None yet

2 participants

@dilipkrish

For example if I had 2 source files, both having different destinations. I tried configuring the replace task like so

replace: {
       ...
                options: {
                    variables: {
                        'version' : '<%= pkg.version %>',
                        'buildTime' : '<%= grunt.template.today("yyyy-mm-dd hh:mm") %>'
                    }
                },
                files: [
                    {src: ['src/file1.js'], dest: 'dest/js' },
                    {src: ['src/file2.html'], dest: 'dest/html' }
                ]
      ....      
          }

It seems to only pick up the first file for replacement

Owner

Hi pal, you cold try with:

replace: {
       ...
                options: {
                    variables: {
                        'version' : '<%= pkg.version %>',
                        'buildTime' : '<%= grunt.template.today("yyyy-mm-dd hh:mm") %>'
                    }
                },
                files: [
                    {expand: true, flatten: true, src: ['src/file1.js'], dest: 'dest/js' },
                    {expand: true, flatten: true, src: ['src/file2.html'], dest: 'dest/html' }
                ]
      ....      
          }

let me know if works ...

@outaTiME Thanks! thats what I started out with and it didnt seem to work.

So I went and rewrote the same thing from scratch instead of copy paste from the readme and that worked! Weird!

@dilipkrish dilipkrish closed this Mar 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment