扫码关注官方订阅号
gulp.src('src/js//*.js').pipe("求解怎么在这个pipe里取到目录名和*.js文件名")
欢迎选择我的课程,让我们一起见证您的进步~~
用through2这个插件。
through2
jsvar through = require('through2'); gulp.task('xx',function(){ return gulp.src('src/js/*.js') .pipe(through.obj(function(file,enc,cb){ console.log(file.relative); console.log(file.path); this.push(file); cb(); })) });
js
var through = require('through2'); gulp.task('xx',function(){ return gulp.src('src/js/*.js') .pipe(through.obj(function(file,enc,cb){ console.log(file.relative); console.log(file.path); this.push(file); cb(); })) });
取决于你要干嘛
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
用
through2这个插件。取决于你要干嘛