yeoman/grunt-usemin — pull request #337 by mcampo (2014-04-06 22:35:37+00:00)
Title: add suport for block replacement for custom block types

Be able to define custom block replacement logic for custom block types (types other than 'css' and 'js').

We can have a "less" block type and define a flow for it and configure the "less" task properly. The resulting css file is generated and placed in the correct dest directory.

But blocks with type other that "css" or "js" won't be correctly "summarized" in the html. I get "undefined" instead of the proper "link" tag referencing the output file.

Main motivation in my case is to be able to define a block for .less files, call less processor in a custom flow (already possible) and have the resulting css file included in a single 'link' tag. This PR addresses the last part.

With this PR, you can have:

This block in your html
```html

...

```

this configuration:
```js
useminPrepare: {
html: 'index.html',
options: {
dest: 'dist',
flow: {
steps: {
'js': ['concat', 'uglifyjs'],
'css': ['concat', 'cssmin'],
'less': [{
name: 'less',
createConfig: lessCreateConfig
}]
},
post: {}
}
}
},

usemin: {
html: ['dist/index.html'],
options: {
blockReplacements: {
less: function (block) {
return '';
}
}
}
}
```

and have this result:
```html

```

If this works out for you, I can help updating the docs too.

What do you think?