wishthis/node_modules/gulp-copy/example/gulpfile.js

28 lines
581 B
JavaScript
Raw Normal View History

2022-01-21 08:28:41 +00:00
var copy = require('../index');
var gulp = require('gulp');
var through = require('through2');
gulp.task('default', copyFunction);
function copyFunction() {
return gulp
.src([' ./files/.*', './files/*.*'])
.pipe(copy('output/test', { prefix: 1 }))
.pipe(verify());
}
function verify() {
var options = { objectMode: true };
return through(options, write, end);
function write(file, enc, cb) {
console.log('file', file.path);
cb(null, file);
}
function end(cb) {
console.log('done');
cb();
}
}