2

Given this simple setup:

concat: {
        options: {
            stripBanners: false,
            separator: '\n/* path to js file */\n'
        },
        dist: {
            src: ['js/*.js'],
            dest: 'dist/<%= pkg.name %>-concat.js'
        }
    }

Is there any way to dynamically include the concatenated path in each separator?

The ideal concatenated file should be:

/* js/file1.js */
var someFunction = function(){

}

/* js/file2.js */
var anotherFunction = function(){
}

I'm new to Grunt, any ideas appreciated.

Thanks,

Seb.

timss
  • 9,982
  • 4
  • 34
  • 56
Seb
  • 89
  • 1
  • 8

1 Answers1

1

in the process options you can put of this manner

process: function(src, filepath) {
        console.log('// Source: ' + filepath + '\n'); ;
        return '// Source: ' + filepath + '\n'+src;
      }