-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
50 lines (41 loc) · 1.16 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
var SERVER_CONNECTION = 'web@materia.localhorst.io';
var SERVER_DEST = '~/index';
// Load Gulp and your plugins
var gulp = require('gulp');
var autoprefixer = require('autoprefixer-stylus');
var $ = require('gulp-load-plugins')();
var path = require('path');
var paths = {
styles: 'styl/*.styl',
mainStyl: 'styl/main.styl',
dist: 'dist',
distCSS: '/css'
};
gulp.task('upload', function() {
gulp.src(paths.dist)
.pipe($.rsync({
root: paths.dist,
recursive: true,
compress: true,
progress: true,
hostname: SERVER_CONNECTION,
destination: SERVER_DEST
}));
});
gulp.task('stylus', function () {
gulp.src(paths.mainStyl)
.pipe($.plumber())
.pipe($.stylus({
use: autoprefixer({browsers: ['Firefox > 5%', 'Explorer 9', 'Chrome > 5%', 'Safari > 5%']}),
compress: true,
'include css': true
}))
.pipe(gulp.dest(path.join(paths.dist, paths.distCSS)))
});
// Watch task
gulp.task('watch', function () {
gulp.watch(paths.styles, ['stylus']);
});
//default task
gulp.task('default', ['stylus','watch']);
gulp.task('deploy', ['stylus','upload']);