-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
68 lines (57 loc) · 1.58 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var gulp = require('gulp');
var gulpSequence = require('gulp-sequence');
var gulpConnect = require("gulp-connect");
var gulpOpen = require("gulp-open");
var gulpConfig = require("./gulp.config.json");
var portNum = gulpConfig.dev.port;
//task:启动server
gulp.task("server", function(){
return gulpConnect.server({
port: portNum,
debug: true
});
});
//task:打开测试页
gulp.task("openBrowser",function(){
var pageAUrl = gulpConfig.dev.pageAUrl;
var pageBUrl = gulpConfig.dev.pageBUrl;
return gulp.src('')
.pipe(gulpOpen({
uri:pageAUrl
}))
.pipe(gulpOpen({
uri:pageBUrl
}));
});
//task:打开postMessage测试页
gulp.task("openBrowser_postMessage",function(){
var pageUrl = gulpConfig.dev.pageUrl_postMessage;
return gulp.src('')
.pipe(gulpOpen({
uri:pageUrl
}));
});
//task:打开localStorage测试页
gulp.task("openBrowser_localStorage",function(){
var pageUrl = gulpConfig.dev.pageUrl_localStorage;
return gulp.src('')
.pipe(gulpOpen({
uri:pageUrl
}));
});
//task:打开util-v2测试页
gulp.task("openBrowser_util",function(){
var pageA = gulpConfig.dev.pageA_util_v2;
var pageB = gulpConfig.dev.pageB_util_v2;
return gulp.src('')
.pipe(gulpOpen({
uri:pageA
}))
.pipe(gulpOpen({
uri:pageB
}));
});
gulp.task("dev", gulpSequence(['server','openBrowser']));
gulp.task("postMsg", gulpSequence(['server','openBrowser_postMessage']));
gulp.task("localStorage", gulpSequence(['server','openBrowser_localStorage']));
gulp.task("util", gulpSequence(['server','openBrowser_util']));