-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
49 lines (42 loc) · 1.21 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
var gulp = require('gulp'),
gutil = require('gulp-util'),
minifyHtml = require('gulp-minify-html'),
minifyCss = require('gulp-minify-css')
ftp = require( 'vinyl-ftp' ),
path = require('path');
var paths = {
html: './public/**/*.html',
css: './public/branding/css/*.css',
css_dest: './public/branding/css/',
dest: './public',
};
gulp.task('minify-html', function () {
return gulp.src(paths.html)
.pipe(minifyHtml({}))
.pipe(gulp.dest(paths.dest));
});
gulp.task('minify-css', function() {
return gulp.src(paths.css)
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(gulp.dest(paths.css_dest));
});
gulp.task('deploy', function () {
var connection = ftp.create({
host: process.env.FTP_HOST,
user: process.env.FTP_USER,
password: process.env.FTP_PASSWORD,
secureOptions: true,
rejectUnauthorized: false,
parallel: 2,
log: gutil.log
});
var output = './public/**';
return gulp.src(output, {
base: './public',
buffer: false
})
.pipe(connection.newer('/'))
.pipe(connection.dest('/'));
})
gulp.task('default', ['build']);
gulp.task('build', ['minify-html', 'minify-css']);