Gulp plugin for easily defining destination paths using path variables.
Install with npm
$ npm i gulp-dest --save
var dest = require('gulp-dest');
var gulp = require('gulp');
gulp.task('default', function() {
gulp.src(['a.hbs', 'b.hbs', 'c.hbs'])
.pipe(dest('dist', {ext: '.html'}))
.pipe(gulp.dest('./'))
});
//=> ['dist/a.html', 'dist/b.html', 'dist/c.html']
dest(directory, options);
// example
dest('dist', { ext: '.html' });
{String}: Optionally define a path to be append to the path (file.base) specified in gulp.dest(){Object}: Pass file path properties to use. Supported properties are ext or extname, dirname and basename (although I'm not sure why you would use it)Dynamically replace variables with actual path values:
Examples
// Given: ['a.coffee', 'b.coffee', 'c.min.coffee']
dest(':name.js');
//=> ['a.js', 'b.js', 'c.min.js']
// Given: ['foo/a.coffee', 'bar/b.coffee', 'baz/c.coffee']
dest('qux/:name.js');
//=> ['qux/a.js', 'qux/b.js', 'qux/c.js']
Any properties defined on the options can be used as path variables:
Example
var dest = require('gulp-dest');
var gulp = require('gulp');
gulp.task('default', function() {
gulp.src(['a.coffee', 'b.coffee', 'c.coffee'])
.pipe(dest(':foo/:name.js', {foo: 'bar'}))
.pipe(gulp.dest('.'))
});
//=> ['bar/a.js', 'bar/b.js', 'bar/c.js']
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on October 27, 2015.