-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (29 loc) · 941 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
29
30
31
32
33
34
35
36
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const uglify = require('gulp-uglify');
const imagemin = require('gulp-imagemin')
function funcaoPadrao(callback) {
console.log('execultanto via gulp');
callback();
}
function comprimeImagens() {
return gulp.src('./source/images/*')
.pipe(imagemin())
.pipe(gulp.dest('./build/images'));
}
function comprimeJavaScript() {
return gulp.src('./source/scripts/*.js')
.pipe(uglify())
.pipe(gulp.dest('./build/scripts'))
}
function compilaSass() {
return gulp.src('./source/styles/*.scss')
.pipe(sass({
outputStyle: 'compressed'
}))
.pipe(gulp.dest('./build/styles'));
}
exports.default = gulp.series(funcaoPadrao, compilaSass, comprimeImagens, comprimeJavaScript)
exports.sass = compilaSass;
exports.javascript = comprimeJavaScript;
exports.images = comprimeImagens;