var gulp = require('gulp'),
less = require('gulp-less'),
cssmin = require('gulp-cssmin'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename');
gulp.task('watch', function () {
gulp.watch('./styles/*.less', ['less']);
});
gulp.task('less', function () {
gulp.src('./styles/*.less')
.pipe(plumber())
.pipe(less())
.pipe(gulp.dest('./styles/'))
.pipe(cssmin())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./styles'))
});
gulp.task('default', ['less', 'watch']);
var ajaxSettings = {
method: form.method,
url: form.action,
data: JSON.stringify(data),
// dataType: form.method === 'get' ? 'jsonp' : 'json',
dataType: 'json',
contentType: 'application/json',
processData: false,
xhrFields: {
withCredentials: true
}
};
var ajaxRequest = $.ajax(ajaxSettings);