-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
51 lines (45 loc) · 1.22 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
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var minifyCSS = require('gulp-minify-css');
gulp.task('webserver', function() {
gulp.src('dist/')
.pipe(webserver({
fallback: 'login.html',
livereload: true,
directoryListing: false,
open: true
}));
});
/*gulp.task('script', function(){
gulp.src('src/js/custom.js')
.pipe(concat('script.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist/js'));
});*/
gulp.task('script', function(){
//tarea
gulp.src('src/js/custom.js')
//unirlo
.pipe(concat('script.min.js'))
//minificarlo
.pipe(uglify())
.pipe(gulp.dest('dist/js'));//para dejarlo en esa carpeta
});
gulp.task('image', function() {
gulp.src('src/**/*.{jpg,jpeg,gif,png,svg}')
.pipe(gulp.dest('dist/img'));
});
gulp.task('style', function(){
gulp.src('src/sass/global.scss')
.pipe(sass().on('error', sass.logError))
.pipe(minifyCSS())
.pipe(concat('style.min.css'))
.pipe(gulp.dest('dist/css'))
});
gulp.task('watch', function(){
gulp.watch('src/sass/**/*.scss', ['style']);
});
gulp.task('default', ['style','script','image','webserver']);