miickel/gulp-angular-templatecache — pull request #8 by kjbekkelund (2014-01-21 18:59:59+00:00)
Title: make filename optional

I've used this plugin in a couple of projects now, and I haven't yet needed the filename. My pattern:

```javascript
function jsFiles() {
return gulp.src('./some/path/**/*.js');
}
function angularTemplates() {
return gulp.src('./some/path/**/*.html')
.pipe(htmlmin())
.pipe(templates('templates.js'));
}

gulp.task('js', function() {
return es.concat(jsFiles(), angularTemplates())
.pipe(concat('app.js'))
.pipe(uglify())
.pipe(gulp.dest('./build'));
});
```

So I never end up writing the templates file to any folder, it's just a temporary file. `templates.js` is unnecessary in this case.

In the pull request I've handled the following cases:

- `templates()` => `filename = 'templates.js', options = {}`
- `templates(filename)` => `options = {}`
- `templates(options)` => `filename = 'templates.js'`
- `templates(filename, options)`

Not sure about this one, but it feels nice not having to specify an unnecessary parameter.