gruntjs/grunt-contrib-concat — pull request #25 by Skalman (2013-04-14 13:33:35+00:00)
Title: Add option to process files with a custom function

The `process` option can now take a function which will be called once for each file. The returned value will be used as the source code.

Here's my use case:

```js
// Replace all 'use strict' statements in the code with a single one at the top:
runt.initConfig({
concat: {
dist: {
options: {
banner: "'use strict';\n",
process: function(src, filepath) {
return '// Source: ' + filepath + '\n' +
src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
},
},
files: { ... },
},
},
});
```