Giter VIP home page Giter VIP logo

Comments (18)

zhufengnodejs avatar zhufengnodejs commented on May 18, 2024
var a = 10;

from 201508gulp.

Brolly0204 avatar Brolly0204 commented on May 18, 2024
var aa=0;
gulp.task("one",function(){
    console.log(1);
});
gulp.task("two",function(cd){
   setTimeout(function(){
        console.log(2);
        aa+=3;
        cd();
    },3000)
});
gulp.task("three",function(){
    console.log(3);
    aa+=3
});
gulp.task("default",["one","two","three"],function(){
    console.log(aa)
});
Mr.Li@PC-Li MINGW64 /d/gulpstudy
$ gulp default
[15:46:23] Using gulpfile D:\gulpstudy\gulpfile.js
[15:46:23] Starting 'one'...
1
[15:46:23] Finished 'one' after 788 μs
[15:46:23] Starting 'two'...
[15:46:23] Starting 'three'...
3
[15:46:23] Finished 'three' after 102 μs
2
[15:46:26] Finished 'two' after 3 s
[15:46:26] Starting 'default'...
6
[15:46:26] Finished 'default' after 84 μs

from 201508gulp.

zhangguiping2015 avatar zhangguiping2015 commented on May 18, 2024
var aaa=10;
gulp.task("1",function(){
    return gulp.src('src/index.html').pipe(gulp.dest('disk'))
    console.log("我是先执行的");
})
gulp.task("2",function(cb){
    setTimeout(function(){
        return gulp.src('src/index.doc').pipe(gulp.dest('disk'))
        console.log("我这个定时器最后执行");
        cb();
    },3000)
})
gulp.task("3",function(){
    return gulp.src('src/index.txt').pipe(gulp.dest('disk'))
    console.log("我是第二个执行的");
})
gulp.task("default",["1","2","3"],function(){
    console.log("我是第三个执行的"+aaa);
})

from 201508gulp.

Liuyundere avatar Liuyundere commented on May 18, 2024
gulp.task("html",function(){
    return gulp.src("history/1.html").pipe(gulp.dest("dist"));
});
gulp.task("js",function(){
    setTimeout(function(){
        return gulp.src("history/1.js").pipe(gulp.dest("dist"));
    },3000);
});
gulp.task("less",function(){
    return gulp.src("history/1.less").pipe(gulp.dest("dist"));
});


gulp.task("default",["html","js","less"]);

from 201508gulp.

qiujinlong11 avatar qiujinlong11 commented on May 18, 2024
gulp.task("one",function(){
    setTimeout(function(){
        console.log('one is done')
    },3000);
});
gulp.task("two",["one"],function(){
    console.log('two is done')
});
gulp.task("3",function(){
    console.log('3 is done')
});

gulp.task("default",["one","two","3"],function(){
    console.log("232321")
})

from 201508gulp.

renjinhui avatar renjinhui commented on May 18, 2024

#任金辉

var gulp=require("gulp");
var abc=10;
gulp.task("1",function(){
    console.log(1);
});

gulp.task("2",function(cb){
    setTimeout(function(){
        console.log(2);
        abc++;
        cb();
    },2000)

});

gulp.task("3",function(){
    console.log(3);
});

gulp.task("CP-html",function(){
    return gulp.src("*.json").pipe(gulp.dest("dist"));
});

gulp.task("default",["1","2","3","CP-html"],function(){
    console.log(abc);
});

from 201508gulp.

liuying0525 avatar liuying0525 commented on May 18, 2024
gulp.task("one",function(){
    gulp.src("src/a.js").pipe(gulp.dest("list/foo.js/temp"))
});

gulp.task("two",function(ed){
    setTimeout(function(){
        gulp.src("src/*/*.js").pipe(gulp.dest("list/foo.js/temp"));
        ed();
    },3000);
});

gulp.task("three",function(){
    gulp.src("src/**/*.js").pipe(gulp.dest("list/foo.js/temp"))
});

gulp.task("default",["one","two","three"]);
[15:51:14] Using gulpfile d:\gulpstudy\gulpfile.js
[15:51:14] Starting 'one'...
[15:51:14] Finished 'one' after 7.87 ms
[15:51:14] Starting 'two'...
[15:51:14] Starting 'three'...
[15:51:14] Finished 'three' after 3.01 ms
[15:51:17] Finished 'two' after 3 s
[15:51:17] Starting 'default'...
[15:51:17] Finished 'default' after 8.29 μs

from 201508gulp.

da-panggui avatar da-panggui commented on May 18, 2024
var a=10;
gulp.task("1",function(){
    console.log("1")
});

gulp.task("2",function(bc){
    setTimeout(function(){
        a+=20;
        console.log("2");
        bc();
    },2000)

});
gulp.task("3",function(){
    console.log("3")
});

gulp.task("default",["1","2","3"],function(){
   console.log(a)
});

from 201508gulp.

luoaihua919 avatar luoaihua919 commented on May 18, 2024
var aa=10;
gulp.task('one',function(){
    console.log(1);
});
gulp.task('two',function(cb){
    setTimeout(function(){
        gulp.src('src/*.js').pipe(gulp.dest('desk'));
        console.log(2);
        aa++;
        cb();
    },3000);
});
gulp.task('three',function(){
    gulp.src('src/index.html').pipe(gulp.dest('desk'));
    aa+=2;
});
gulp.task('default',['one','two','three'],function(){
    console.log(aa);
});

from 201508gulp.

wangxiaobo718 avatar wangxiaobo718 commented on May 18, 2024
var aaa=10;
var gulp=require("gulp");

gulp.task("1",function(){
    console.log("1")
});
gulp.task("2",function(){
    console.log("2")
});
gulp.task("3",function(){
    console.log("3")
    aaa+=3
});
gulp.task("default",["1","2","3"],function(){
    console.log(aaa);
});

from 201508gulp.

lomo1314 avatar lomo1314 commented on May 18, 2024
var aaa=10;
var gulp = require("gulp");

gulp.task('1', function () {
    console.log('1')
})
gulp.task('2', function () {
    console.log('2');
})

gulp.task('3', function () {
    console.log('3');
    aaa+=3
})

gulp.task("default",['1','2','3'], function () {
    console.log(aaa);
})

from 201508gulp.

yuhongtao1 avatar yuhongtao1 commented on May 18, 2024
var gulp=require("gulp");
gulp.task("ok",function(){
    setTimeout(function(){
        console.log("jhuhuhu");
    },5000);
});
gulp.task("default",["ok"],function(){
    console.log("default")
});
gulp.task("copy",["ok"],function(){
    return gulp.src("data.txt").pipe(gulp.dest("duration"))
});

gulp.task("default",["copy","ok"]);

from 201508gulp.

 avatar commented on May 18, 2024
var gulp = require('gulp');
var sum = 0;
gulp.task('default', ['one', 'two'], function () {
    console.log(sum);
});

gulp.task('one', function (callBack) {
    setTimeout(function () {
        sum += 1;
        console.log(sum);
        callBack();
    }, 2000);
});

gulp.task('two', function () {
    sum += 2;
    console.log(sum);
});

from 201508gulp.

cjleung avatar cjleung commented on May 18, 2024
 // 第一个参数是任务的名字
    var gulp = require('gulp');

// 第二个参数是本任务
    /*
    gulp.task('任务名', function(){
        // 就是把gulp笔记.html 拷贝一份到 dist 这个目录里去一份
        gulp.src('src/gulp笔记.html').pipe(gulp.dest('dist'));
    });
    */
    gulp.task('html', function(){
        gulp.src('src/index.html').pipe(gulp.dest('dist'));
    });

    gulp.task('css', function(){
        gulp.src('src/css.css').pipe(gulp.dest('dist'));
    });

    gulp.task('javascript', function(){
        gulp.src('src/javascript.js').pipe(gulp.dest('dist'));
    });

    gulp.task('NodeJs', function(){
        gulp.src('src/NodeJs.js').pipe(gulp.dest('dist'));
    });

    gulp.task("default",["html","css","javascript","NodeJs"],function(){
        console.log("拷贝完成....100%");
    });
F:\gulplop>gulp default
[16:03:24] Using gulpfile F:\gulplop\gulpfile.js
[16:03:24] Starting 'html'...
[16:03:24] Finished 'html' after 10 ms
[16:03:24] Starting 'css'...
[16:03:24] Finished 'css' after 15 ms
[16:03:24] Starting 'javascript'...
[16:03:24] Finished 'javascript' after 1.27 ms
[16:03:24] Starting 'NodeJs'...
[16:03:24] Finished 'NodeJs' after 715 μs                                                                                                                                                     
[16:03:24] Starting 'default'...
拷贝完成....100%                                                                                                                                                                               
[16:03:24] Finished 'default' after 260 μs  

from 201508gulp.

wangmengyuan avatar wangmengyuan commented on May 18, 2024
var gulp = require('gulp');
var num = 0;
gulp.task("one", function () {
    console.log("one");
});
gulp.task("two", function (a) {
    setTimeout(function () {
        console.log("two");
        num += 1;
        a();
    }, 3000)
});
gulp.task("three", function () {
    console.log("three");
    num += 3
});
gulp.task("default", ["one", "two", "three"], function () {
    console.log(num)
});

from 201508gulp.

yuzhi000 avatar yuzhi000 commented on May 18, 2024
var gulp= require("gulp");
gulp.task("1",function(){
    setTimeout(function(){
        console.log('最后')
    },3000);
});
gulp.task("2",function(){
    console.log('two is done 第一')
});
gulp.task("3",function(){
    console.log('3 is done 第二')
});
gulp.task("4",["2"],function(){
    console.log('4 is done 第三')
});

gulp.task("default",["1","2","3","4"],function(){
    console.log("哈哈 第四")
});

from 201508gulp.

wangwensha avatar wangwensha commented on May 18, 2024
var aa=0;
gulp.task("one",function(){
    console.log(1);
});
gulp.task("two",['one'],function(cd){
    setTimeout(function(){
        console.log("2");
        aa+=3;
        cd();
    },3000)
});
gulp.task("three",function(){
    console.log(3);
    aa+=3
});
gulp.task("default",["two","three"],function(){
    console.log(aa)
});

from 201508gulp.

niuxiaoxin123 avatar niuxiaoxin123 commented on May 18, 2024
var a=10;
gulp.task('1',function(){
    console.log('1');
    a=3;
})
gulp.task('2',function(){
    setTimeout(function(){
        console.log('1122');
        a+=5;
    },3000)
})
gulp.task('3',function(){
    console.log('3');
    a++;
})
gulp.task('default',['1','2','3'],function(){
    console.log(a);
})

from 201508gulp.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.