Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const gulp = require('gulp');
- const browserSync = require('browser-sync').create();
- const sass = require('gulp-sass');
- const autoprefixer = require('gulp-autoprefixer');
- const concat = require('gulp-concat');
- const rename = require('gulp-rename');
- const uglify = require('gulp-uglify');
- const babel = require('gulp-babel');
- const gutil = require('gutil');
- const ftp = require('vinyl-ftp');
- var localFiles = [
- './dist/js/*.js',
- './dist/css/*.css'
- ];
- function getFtpConnection(){
- return ftp.create({
- host: '163.172.255.114',
- port: 21,
- user: 'carismaclassic_developer',
- password: 'osQPfh4fCu',
- log: gutil.log
- });
- }
- const remoteLocation = '/public_html/wp-content/themes/classiccarsmadrid/assets/';
- gulp.task('remote-deploy', function(){
- const conn = getFtpConnection();
- return gulp.src(localFiles, {base: '.', buffer: false})
- .pipe(conn.newer(remoteLocation))
- .pipe(conn.dest(remoteLocation))
- });
- gulp.task('scripts-lib', function () {
- const conn = getFtpConnection();
- return gulp.src([
- './js/jquery-3.1.1.min.js',
- './js/jquery.fancybox.min.js',
- './js/jquery.nice-select.min.js',
- './js/owl.carousel.min.js',
- './js/map.js',
- './js/slaider_blog.js',
- './js/slaider_video.js',
- './js/script.js',
- ])
- // .pipe(uglify())
- .pipe(concat('app.min.js'))
- .pipe(gulp.dest('./dist/js/'));
- // .pipe(conn.dest(remoteLocation + '/dist/js/'));
- });
- // gulp.task('sass', function () {
- // const conn = getFtpConnection();
- // return gulp.src("./scss/*.scss")
- // .pipe(sass({outputStyle: 'compressed'}))
- // .pipe(autoprefixer({
- // browsers: [
- // 'last 2 versions',
- // 'ie 9',
- // 'android 2.3',
- // 'android 4',
- // 'opera 12'
- // ],
- // cascade: false
- // }))
- // .pipe(rename('app.min.css'))
- // .pipe(gulp.dest("./dist/css"));
- // // .pipe(conn.dest(remoteLocation + '/dist/css/'))
- // // .pipe(browserSync.stream());
- // });
- gulp.task('serve', ['scripts-lib'], function () {
- gulp.watch("./js/*.js", ['scripts-lib']);
- // gulp.watch("./scss/**/*.scss", ['sass']);
- // gulp.watch("./scss/*.scss", ['sass']);
- });
- gulp.task('default', ['serve']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement