forked from jhipster/jhipster.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (36 loc) · 1.29 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
var gulp = require("gulp"),
browserSync = require('browser-sync').create(),
sass = require("gulp-sass"),
imagemin = require('gulp-imagemin');
gulp.task('images', ['min-img', 'min-images', 'min-company-logo'])
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.task('init-server', function() {
browserSync.init({
server: {
baseDir: "./"
}
});
});
gulp.task('dev', ['sass','watch','init-server']);