-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
66 lines (53 loc) · 1.69 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
/**
* Created by laury.lu on 2015/4/15.
*/
var gulp = require('gulp')
var sass = require('gulp-sass')
var livereload = require('gulp-livereload')
var sftp = require('gulp-sftp')
var path = require('path')
//var watch = require('gulp-watch');
gulp.task('sass', function () {
//console.log(arguments)
return gulp.src('src/css/*.scss')
.pipe(sass())
.pipe(gulp.dest('dist/css'))
});
var tplPath = '/works/temp/my-templates/**/*html'
gulp.task('watch', function () {
//livereload.listen()
//var watcher = gulp.watch('src/**/*.scss',['sass'])
//watcher.on('change',function(evt){
// console.log(evt);
//})
var tplWatcher = gulp.watch(tplPath, ['uploadTest'])
// tplWatcher.on('change',function(evt){
// gulp.src(evt.path)
// .pipe(sftp({
// host: '192.168.146.108',
// user: 'luhuan',
// pass: 'luhuan123',
// remotePath:'./dest_folder'
// }))
// })
console.log(tplWatcher)
})
//todo
gulp.task('uploadTest', function () {
console.log(arguments[0])
// return gulp.src(tplPath)
// .pipe(sftp({
// host: '192.168.146.108',
// user: 'luhuan',
// pass: 'luhuan123',
// remotePath:'./dest_folder'
// }))
})
gulp.task('watchViews', function () {
gulp.watch('./view-practise/**/src/*.scss', (evt) => {
gulp.src(evt.path)
.pipe(sass().on('error', sass.logError))
//spriter
.pipe(gulp.dest(path.join(path.resolve(path.dirname(evt.path), '..', 'dist'))))
})
})