-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
94 lines (76 loc) · 1.97 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
*
* Modules
*
*/
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
cleanCSS = require('gulp-clean-css'),
sourcemaps = require('gulp-sourcemaps'),
babel = require('gulp-babel'),
notify = require('gulp-notify'),
concat = require('gulp-concat'),
paths = require('./resources/scripts/settings/paths.js');
/*
*
* TASKS
*
*/
gulp.task('scss', function() {
return gulp.src([paths.scssSrc + '**/*.scss'])
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(autoprefixer())
.pipe(cleanCSS())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.cssDest))
.pipe(notify('Processed SCSS'));
});
gulp.task('js', function() {
return gulp.src([paths.jsSrc + '**/*.js', '!vendor/*.js'])
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(uglify())
.pipe(concat('acf-hotspots-render.js'))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.jsDest))
.pipe(notify('Processed JS'));
});
gulp.task('js_vendors', function() {
return gulp.src(paths.jsVendors)
.pipe(uglify())
.pipe(gulp.dest(paths.jsDest + 'vendor/'))
.pipe(notify('Processed JS Vendors'));
});
gulp.task('css_vendors', function() {
return gulp.src(paths.cssVendors)
.pipe(cleanCSS())
.pipe(gulp.dest(paths.cssDest + 'vendor/'))
.pipe(notify('Processed CSS Vendors'));
});
gulp.task('html', function() {});
gulp.task('images', function() {});
gulp.task('ftp', function() {
return gulp.src('./public/**/*')
.pipe(plumber())
.pipe(ftp(ftp_settings))
.pipe(notify('Uploaded file'));
});
gulp.task('watchers', function(){
gulp.watch(paths.scssSrc + '**/*.scss', ['scss']);
gulp.watch([paths.jsSrc + '**/*.js', '!vendor/*.js'], ['js']);
});
gulp.task('default', [
'scss',
'js',
'js_vendors',
'css_vendors',
'html',
'images',
'watchers'
]);