forked from udacity/mws-restaurant-stage-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (43 loc) · 1.1 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
52
53
54
let gulp = require('gulp');
let concat = require('gulp-concat');
let sourcemaps = require('gulp-sourcemaps');
let imagemin = require('gulp-imagemin');
let cleanCSS = require('gulp-clean-css');
const webp = require('gulp-webp');
var cssnano = require('gulp-cssnano');
const minify = require('gulp-minify');
gulp.task('default', defaultTask);
gulp.task('test', [
'scripts-dist',
'imagemin',
'minify-css',
]);
gulp.task('compress', function() {
gulp.src('js/*.js')
.pipe(minify())
.pipe(gulp.dest('dist/js'))
});
gulp.task('imagemin', function() {
return gulp.src('img/*.jpg')
.pipe(imagemin([
imagemin.jpegtran({
progressive: true
}),
]))
.pipe(gulp.dest('dist/img'));
});
gulp.task('webp', () =>
gulp.src('img/*.jpg')
.pipe(webp())
.pipe(gulp.dest('dist/img'))
);
gulp.task('styles', function () {
return gulp.src('css/styles.css')
.pipe(cssnano())
.pipe(gulp.dest('./dist/css'));
});
function defaultTask(done) {
// place code for your default task here
console.log("pfft");
done();
}