Skip to content

Instantly share code, notes, and snippets.

@Belrestro
Created January 10, 2017 12:03
Show Gist options
  • Save Belrestro/6db894d8ed8056d8738f2c7ca53d9e84 to your computer and use it in GitHub Desktop.
Save Belrestro/6db894d8ed8056d8738f2c7ca53d9e84 to your computer and use it in GitHub Desktop.
Gulp config
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