Created
January 10, 2017 12:03
-
-
Save Belrestro/6db894d8ed8056d8738f2c7ca53d9e84 to your computer and use it in GitHub Desktop.
Gulp config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var watch = require('gulp-watch'); | |
var sass = require('gulp-sass'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var cleanCSS = require('gulp-clean-css'); | |
var rename = require('gulp-rename'); | |
var ftp = require('gulp-ftp'); | |
/* */ | |
var ftpAccess = { | |
site: {host:'hostname', user:'user', pass:'password', remotePath: '/'} | |
}; | |
/* FTP */ | |
var options = ftpAccess.site; | |
/* Minify CSS */ | |
gulp.task('css', function() { | |
gulp.src('style.scss') | |
.pipe(sass()) | |
.pipe(autoprefixer('last 15 versions')) | |
.pipe(cleanCSS()) | |
.pipe(rename('style.min.css')) | |
.pipe(ftp(options)) | |
.pipe(gulp.dest('source')); | |
}); | |
/* GULP watch */ | |
gulp.task('watch', function() { | |
gulp.watch('style.scss', ['css']); | |
}); | |
/* GULP default */ | |
gulp.task('default', ['css']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment