Skip to content

make filename optional#8

Merged
miickel merged 1 commit intomiickel:masterfrom
kimjoar:dont-require-filename
Jan 25, 2014
Merged

make filename optional#8
miickel merged 1 commit intomiickel:masterfrom
kimjoar:dont-require-filename

Conversation

@kimjoar
Copy link
Copy Markdown
Contributor

@kimjoar kimjoar commented Jan 21, 2014

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

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.

miickel added a commit that referenced this pull request Jan 25, 2014
@miickel miickel merged commit 84dd59d into miickel:master Jan 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants