forked from zxwandrew/ArcGISFly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
89 lines (78 loc) · 2.19 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
plumber = require('gulp-plumber'),
livereload = require('gulp-livereload');
var babel = require('gulp-babel');
var requirejs= require('gulp-requirejs')
gulp.task('app', function(){
return gulp.src("src/app.js")
.pipe(babel())
.pipe(gulp.dest(""));
});
// gulp.task('viewstatic', function(){
// return gulp.src(['src/views/*.jade', 'src/views/**/*.html'])
// .pipe(gulp.dest("views"));
// });
//
// gulp.task('viewjs', function(){
// return gulp.src("src/views/**/*.js")
// .pipe(babel())
// .pipe(gulp.dest('views'));
// })
//
// gulp.task('routesjs', function(){
// return gulp.src("src/routes/*.js")
// .pipe(babel())
// .pipe(gulp.dest('routes'));
// })
gulp.task('libjs', function(){
return gulp.src(["!src/libs/**/*route.js", "!src/libs/**/dojoConfig.js", "src/libs/**/*.js"])
.pipe(babel({ "plugins": ["transform-es2015-modules-amd"] }))
.pipe(gulp.dest('public/libs'))
})
gulp.task('libjsroute', function(){
return gulp.src("src/libs/**/*route.js")
.pipe(babel())
.pipe(gulp.dest('public/libs'))
})
gulp.task('libstatic', function(){
return gulp.src(['src/libs/*.jade', 'src/libs/**/*.html', "src/libs/**/dojoConfig.js",])
.pipe(gulp.dest('public/libs'))
})
gulp.task('watch', function(){
gulp.watch(['src/***/**/*.*', 'src/*.*', 'src/**/*.*'], ['libjs', 'libjsroute', 'libstatic']);
});
gulp.task('develop', function () {
// livereload.listen();
// nodemon({
// script: 'bin/www',
// debug: true,
// ext: 'js',
// stdout: false
// }).on('readable', function () {
// this.stdout.on('data', function (chunk) {
// if(/^Express server listening on port/.test(chunk)){
// livereload.changed(__dirname);
// }
// });
// this.stdout.pipe(process.stdout);
// this.stderr.pipe(process.stderr);
// });
nodemon({
script: 'bin/www',
debug: true,
ext: 'js',
env:{
'NODE_ENV': 'development'
}
})
.on('start', ['watch'])
.on('change', ['watch'])
.on('restart', function(){
console.log("restart")
});
});
gulp.task('production', ['libjs', 'libjsroute', 'libstatic']);
gulp.task('default', [
'develop'
]);