Giter VIP home page Giter VIP logo

Comments (3)

gtg092x avatar gtg092x commented on July 4, 2024

I'll have to try and recreate. Though I'm just using the steam as I get it.

Sent with AquaMail for Android
http://www.aqua-mail.com

On May 8, 2014 1:59:29 PM Jonathan Goode [email protected] wrote:

Can't seem to only upload files that have changed after minification.

e.g.

var gulp = require('gulp');

var plumber = require('gulp-plumber'),
    changed = require('gulp-changed'),
    minifycss = require('gulp-minify-css'),
    sftp = require('gulp-sftp'),
    gutil = require('gulp-util')
;

var src = './src/',
    dist = './dist/';

var srcStyles = src + '**/*.css';
var distStyles = dist + '**/*.css';

var host = 'ftp.xxxx.xx.xx',
    auth = 'keyMain',
    remotePath = 'public_html';

/*------------------------------------------------*/

var onError = function(error){
    gutil.beep();
    console.log(error);
};

/*------------------------------------------------*/

gulp.task('compilecssremote', function(){
    gulp.src(srcStyles)
        .pipe(plumber({
            errorHandler: onError
        }))
        .pipe(changed(dist)) //must be dist
        .pipe(minifycss({keepBreaks: true}))
        .pipe(gulp.dest(dist))
    ;
});

gulp.task('uploadcss', function(){
    gulp.src(distStyles)
        .pipe(plumber({
            errorHandler: onError
        }))
        .pipe(changed(dist))
        .pipe(sftp({
            host: host,
            auth: auth,
            remotePath: remotePath
        }))
    ;
});

gulp.task('mainremote', function(){
    gulp.start('compilecssremote');
});

gulp.task('watchremote', function(){
    gulp.watch(srcStyles, ['compilecssremote']);
    gulp.watch(distStyles, ['uploadcss']);
});

/*------------------------------------------------*/

gulp.task('default', ['mainremote', 'watchremote']);

Reply to this email directly or view it on GitHub:
#6

from gulp-sftp.

u01jmg3 avatar u01jmg3 commented on July 4, 2024

Let me know if you need me to test/clarify anything. Thanks

from gulp-sftp.

u01jmg3 avatar u01jmg3 commented on July 4, 2024

Managed to fix this: gulpjs/gulp#465 (comment)

from gulp-sftp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.