-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
47 lines (39 loc) · 1.07 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var concat = require('gulp-concat');
var uglify = require('gulp-uglifyjs'),
imagemin = require('gulp-imagemin');
const paths = {
sass: './assets/sass/**/*.scss',
js: './assets/js/**/**/*.js',
images: './assets/images/**/**/*.png'
}
const dest = {
css: './dist/css/',
js: './dist/js/',
images: './dist/images/'
}
gulp.task('sass', function() {
return gulp.src(paths.sass)
.pipe(sass().on('error', sass.logError))
.pipe(concat('src.css'))
.pipe(gulp.dest(dest.css));
});
gulp.task('js-concat', function() {
return gulp.src(paths.js)
.pipe(concat('src.js'))
// .pipe(uglify())
.pipe(gulp.dest('./dist/js/'));
});
gulp.task('image', () =>
gulp.src(paths.images)
.pipe(imagemin())
.pipe(gulp.dest(dest.images))
);
gulp.task('watch', function(){
gulp.watch(paths.sass, ['sass']);
gulp.watch(paths.js, ['js-concat']);
});
gulp.task('default', ['sass','js-concat', 'image', 'watch']);