Skip to content

Instantly share code, notes, and snippets.

@eiel
Created September 8, 2018 16:51
Show Gist options
  • Save eiel/b0c44ccb67e5ad3daa65d2d3d132d49d to your computer and use it in GitHub Desktop.
Save eiel/b0c44ccb67e5ad3daa65d2d3d132d49d to your computer and use it in GitHub Desktop.
gulp4 done returnのちがい
const { series, src, dest } = require('gulp');
const debug = require('gulp-debug');
function hoge1 () {
return src('src')
.pipe(debug({title: 'hoge1'}))
.pipe(dest('hoge'));
}
function hoge2 () {
return src('src')
.pipe(debug({title: 'hoge2'}))
.pipe(dest('hoge'));
}
function mogu1 (done) {
src('src')
.pipe(debug({title: 'mogu1'}))
.pipe(dest('mogu'));
done();
}
function mogu2 (done) {
src('src')
.pipe(debug({title: 'mogu2'}))
.pipe(dest('mogu'));
done()
}
exports.hoge = series(hoge1, hoge2);
exports.mogu = series(mogu1, mogu2);
[01:50:31] Using gulpfile ~/gulp-sam/gulpfile.js
[01:50:31] Starting 'hoge'...
[01:50:31] Starting 'hoge1'...
[01:50:31] hoge1 src
[01:50:31] hoge1 1 item
[01:50:31] Finished 'hoge1' after 37 ms
[01:50:31] Starting 'hoge2'...
[01:50:31] hoge2 src
[01:50:31] hoge2 1 item
[01:50:31] Finished 'hoge2' after 4.31 ms
[01:50:31] Finished 'hoge' after 43 ms
[01:50:46] Using gulpfile ~/gulp-sam/gulpfile.js
[01:50:46] Starting 'mogu'...
[01:50:46] Starting 'mogu1'...
[01:50:46] Finished 'mogu1' after 8.44 ms
[01:50:46] Starting 'mogu2'...
[01:50:46] Finished 'mogu2' after 1.51 ms
[01:50:46] Finished 'mogu' after 11 ms
[01:50:46] mogu1 src
[01:50:46] mogu1 1 item
[01:50:46] mogu2 src
[01:50:46] mogu2 1 item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment