tactivos/grunt-cdn — pull request #48 by unkstar (2014-02-28 08:36:56+00:00)
Title: allow adding custom supportedTypes

I develop this feature because I have to put a web worker's script on CDN, and inspired by pattern option from [grunt-usemin](https://github.com/yeoman/grunt-usemin)

new option work like this:

```javascript

//define worker type
function Worker_cdn() {
};

Worker_cdn.prototype = {
run : function() {
var self = this;
return this.buffer.replace(/new\s+Worker\(\s*['"]([^"']+)['"]/gm, function(match, url) {
return match.replace(url, self._replace(url));
});
}
};
//and add it to supported type

cdn: {
options: {
cdn:'http://example.com/static/',
flatten:false,
supportedTypes:{"js":Worker_cdn}
},
dist: {
src: [
'<%= yeoman.dist %>/*.html',
'<%= yeoman.dist %>/scripts/*.js'
]
}
}
```

This patch let user inherit from Job interface directly, this give user great flexibility, or maybe too much?
Job._replace may need a better name too.