2016-09-27 105 views
0

你好,我有一些問題,吞嚥。代碼波紋管不會創建DIST /文件夾中的任何gulp.dest不打印到文件

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); 

調試輸出

[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 

但在/創建DIST文件夾什麼。爲什麼會這樣?

回答

2

我相信你的問題是這條線read: false作爲你的gulp.src選項。相反,這樣做:

gulp.src('./src/**/*.js') 
    .pipe(debug()) 
    .pipe(concat('all.js')) 
    .pipe(debug()) 
    .pipe(gulp.dest('./dist/')); 

而且,你只能在你的gulp.src定義一個路徑沒有必要使用數組[]

+0

是的,我發現這是一個問題...我只是寫我自己的答案,但你更快!謝謝! – Rouz

+0

歡迎您:) – Jackthomson