-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
64 lines (52 loc) · 1.74 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
//inicializando GULP
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
imagemin= require('gulp-imagemin'),
pngquant = require('imagemin-pngquant'),
clean = require('gulp-clean'),
minifyCSS = require('gulp-minify-css'),
inject = require('gulp-inject'),
htmlmin = require('gulp-htmlmin'),
streamqueue = require('streamqueue'),
svgmin = require('gulp-svgmin');
var bases = {
app: '/',
dist: 'app/appmin/dist/'
};
//Limpia el Directorio dist
gulp.task('clean', function(){
gulp.src(bases.dist)
.pipe(clean());
});
gulp.task('minjs', ['clean'], function(){
return streamqueue({ objectMode: true },
gulp.src('app/scripts/jquery-1.11.0.min.js'),
gulp.src('app/scripts/bootstrap.min.js'),
gulp.src('app/scripts/jquery.cookie.js'),
gulp.src('app/scripts/jquery.onepage-scroll.js'),
gulp.src('app/scripts/*.js')
)
.pipe(uglify())
.pipe(concat('app.min.js'))
.pipe(gulp.dest(bases.dist + 'scripts'));
});
gulp.task('css', ['clean'], function(){
//acá va la tarea para minificar el css
gulp.src('app/styles/*.css')
.pipe(minifyCSS({compatibility: 'ie8'}))
.pipe(concat('app.min.css'))
.pipe(gulp.dest(bases.dist + 'styles'));
});
gulp.task('minImg', ['clean'], function () {
// tarea para la minificación de img
gulp.src('app/images/*.png')
.pipe(imagemin())
.pipe(gulp.dest(bases.dist + 'images'));
});
gulp.task('svgmin', ['clean'], function () {
return gulp.src('app/images/*.svg')
.pipe(svgmin())
.pipe(gulp.dest(bases.dist + 'svg'));
});
gulp.task('default', ['clean', 'css', 'minjs', 'minImg', 'svgmin' ]);