Skip to content

Instantly share code, notes, and snippets.

@joeLepper
Last active January 3, 2016 01:59
Show Gist options
  • Save joeLepper/8393135 to your computer and use it in GitHub Desktop.
Save joeLepper/8393135 to your computer and use it in GitHub Desktop.
gulp-jade / gulp-rename weirdness
gulp.task('jade', function(){
gulp.src(['src/js/directives/**/jade/*.jade', 'src/jade/views/*.jade'])
.pipe(jade({ pretty : true }))
.pipe(rename(function(dir,base,ext){
var result = base + ext;
return result;
}))
.pipe(gulp.dest('./src/html'));
});
@yocontra
Copy link

This would be a good use case for a plugin if there isn't one already

@joeLepper
Copy link
Author

Yeah. The syntax error is an oversight on my part. I'm actually storing all of these paths in variables in one location so that I can pass them in a way that makes sense to me. When I threw the gist together I forgot to copy the brackets, because computers are hard.

I've amended the gist to reflect this.

I'll start looking at how to spit out flat file tomorrow.

@joeLepper
Copy link
Author

Dear future humans, use this to solve your problem: https://npmjs.org/package/gulp-flatten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment