[英]gulp.dest does not print to file
Hello I am having issues with gulp. 您好,我遇到了问题。 Code bellow does not create anything in dist/ folder
下面的代码不会在dist /文件夹中创建任何内容
function compileSources() {
return gulp.src([ './src/**/*.js' ], {
read: false
})
.pipe(debug())
/*.pipe(concat('all.js'))
.pipe(debug())*/
.pipe(gulp.dest('./dist/'));
}
gulp.task('compile-sources', compileSources);
Debug outputs 调试输出
[10:56:45] Using gulpfile ~/otb-web-app/gulpfile.js
[10:56:45] Starting 'compile-sources'...
[10:56:45] gulp-debug: src/app.js
[10:56:45] gulp-debug: 1 item
[10:56:45] Finished 'compile-sources' after 28 ms
But in /dist folder nothing is created. 但是在/ dist文件夹中什么也没有创建。 Why could that be?
为什么会这样呢?
I believe your problem is this line read: false
as an option on your gulp.src. 我相信您的问题是,这行
read: false
gulp.src中的read: false
选项。 Instead do something like: 而是执行以下操作:
gulp.src('./src/**/*.js')
.pipe(debug())
.pipe(concat('all.js'))
.pipe(debug())
.pipe(gulp.dest('./dist/'));
Also as you are only defining one path in your gulp.src
there's no need to use an array []
. 同样,由于您仅在
gulp.src
定义一个路径,因此无需使用array []
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.