Надо просто изменить Base
gulp.task('deploy', function () {
var conn = ftp.create( {
host: 'host.ru',
user: 'user',
password: 'password',
parallel: 10,
log: gutil.log
});
const path = '/domains/host.ru/public_html';
var globs = [
'dist/**/*.*'
];
conn.rmdir(path, function(e){
if (e === undefined) {
// using base = '.' will transfer everything to /public_html correctly
// turn off buffering in gulp.src for best performance
return gulp.src(globs, {base: 'dist', buffer: false})
// .pipe(conn.newer(path)) // only upload newer files
.pipe(conn.dest(path));
}
return console.log(e);
});
});