-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
28 lines (24 loc) · 867 Bytes
/
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
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const uglify = require('gulp-uglify');
const imagemin = require('gulp-imagemin');
function compilaSass() {
return gulp.src('./source/styles/*.scss')
.pipe(sass())
.pipe(gulp.dest('./build/styles'));
}
function comprimeJS() {
return gulp.src('./source/scripts/*.js')
.pipe(uglify())
.pipe(gulp.dest('./build/scripts'));
}
function comprimeImagens() {
return gulp.src('./source/images/*')
.pipe(imagemin())
.pipe(gulp.dest('./build/images'));
}
exports.default = function() {
gulp.watch('./source/styles/*.scss', {ignoreInitial:false}, gulp.series(compilaSass));
gulp.watch('./source/scripts/*.js', {ignoreInitial:false}, gulp.series(comprimeJS));
gulp.watch('./source/images/*', {ignoreInitial:false}, gulp.series(comprimeImagens));
}