-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
executable file
·44 lines (35 loc) · 1.14 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var gulpIf = require('gulp-if');
var cssnano = require('gulp-cssnano');
var imagemin = require('gulp-imagemin');
var concat = require('gulp-concat');
// var stripDebug = require('gulp-strip-debug');
gulp.task('sass', function(){
// return gulp.src('app/scss/**/*.scss')
return gulp.src('app/scss/style.scss')
.pipe(sass())
.pipe(gulpIf('*.css', cssnano()))
.pipe(gulp.dest(''))
});
gulp.task('uglify', function(){
return gulp.src('app/js/**/*.js')
.pipe(concat('./app.js'))
.pipe(gulpIf('*.js', uglify()))
.pipe(gulp.dest('dest/js'))
});
gulp.task('images', function(){
return gulp.src('app/images/**/*.+(png|jpg|jpeg|gif|svg)')
.pipe(imagemin())
.pipe(gulp.dest('dest/images'))
});
gulp.task('fonts', function() {
return gulp.src('app/fonts/**/*')
.pipe(gulp.dest('dest/fonts'))
})
gulp.task('watch', [ 'sass' , 'uglify' , 'images' , 'fonts' ] , function(){
gulp.watch('app/scss/**/*.scss', ['sass']);
gulp.watch('app/js/**/*.js', ['uglify']);
});