मैं अपने gulpfile को सूखने की कोशिश करता हूं। वहां मेरे पास कोड का छोटा सा डुप्लिकेशंस है जिसके साथ मैं सहज नहीं हूं। इसे बेहतर कैसे बनाया जा सकता है?गुलप में किसी अन्य कार्य को पाइप कैसे करें?
gulp.task('scripts', function() {
return gulp.src('src/scripts/**/*.coffee')
.pipe(coffeelint())
.pipe(coffeelint.reporter())
.pipe(coffee())
.pipe(gulp.dest('dist/scripts/'))
.pipe(gulp.src('src/index.html')) // this
.pipe(includeSource()) // needs
.pipe(gulp.dest('dist/')) // DRY
});
gulp.task('index', function() {
return gulp.src('src/index.html')
.pipe(includeSource())
.pipe(gulp.dest('dist/'))
});
मैं एक अलग कार्य के रूप में index
मिला है, के बाद से मैं src/index.html
देखने के लिए livereload की जरूरत है। लेकिन मैं अपने .coffee
स्रोतों को भी देख रहा हूं और जब वे बदलते हैं, तो मुझे src/index.html
भी अपडेट करना होगा।
index
पर scripts
में मैं कैसे पाइप कर सकता हूं?
संभावित डुप्लिकेट (http://stackoverflow.com/questions/22824546/how- [अन्य के बाद तुल्यकालिक/एक Gulp कार्यों को चलाने के लिए कैसे] टू-रन-गल्प-वर्क्स-सिंक्रोनस-एक-बाद-दूसरे) – falsarella