forked from jhipster/jhipster.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (38 loc) · 1.47 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
var gulp = require("gulp"),
browserSync = require('browser-sync').create(),
sass = require('gulp-sass')(require('sass')),
imagemin = import('gulp-imagemin');
gulp.task('min-img', function () {
return gulp.src('images/logo/**/*.{png,gif,jpg,jpeg}')
.pipe(imagemin({optimizationLevel: 5, progressive: true, interlaced: true}))
.pipe(gulp.dest('images/logo/'));
});
gulp.task('min-images', function () {
return gulp.src('images/*.{png,gif,jpg,jpeg}')
.pipe(imagemin({optimizationLevel: 5, progressive: true, interlaced: true}))
.pipe(gulp.dest('images/'));
});
gulp.task('min-company-logo', function () {
return gulp.src('companies-using-jhipster/images/*.{png,gif,jpg,jpeg}')
.pipe(imagemin({optimizationLevel: 5, progressive: true, interlaced: true}))
.pipe(gulp.dest('companies-using-jhipster/images'));
});
gulp.task("sass", function() {
return gulp.src('./css/scss/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('./css'));
});
gulp.task("watch", function() {
gulp.watch('./css/**/*.scss',['sass']);
gulp.watch(['./js/**/*.js', './**/*.html', './**/*.md']).on('change', browserSync.reload);
});
gulp.task('init-server', function() {
browserSync.init({
server: {
baseDir: "./_site"
}
});
});
gulp.task('images', gulp.parallel('min-img', 'min-images', 'min-company-logo'));
gulp.task('dev', gulp.parallel('sass','watch','init-server'));
gulp.task('default', gulp.series('dev'));