-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
33 lines (26 loc) · 886 Bytes
/
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
// npm install gulp@^4 gulp-imagemin@^7 gulp-gzip@^1 gulp-brotli@^3 --save-dev
/*
* These are small utility tasks to pre-zip files and optimize image compression.
* It is not Angular-specific, but is set up to post-process the generated "dist" folder.
*/
const dist = './dist/angular-material-kickstart/';
const {src, dest, parallel, series} = require('gulp'),
gulpGzip = require('gulp-gzip'),
gulpBrotli = require('gulp-brotli'),
gulpImagemin = require('gulp-imagemin');
function gzip() {
return src([dist + '**/*.{js,html}'])
.pipe(gulpGzip())
.pipe(dest(dist));
}
function brotli() {
return src([dist + '**/*.{js,html}'])
.pipe(gulpBrotli.compress())
.pipe(dest(dist));
}
function imagemin() {
return src(dist + '**/*.{jpg,jpeg,png,gif,svg}')
.pipe(gulpImagemin())
.pipe(dest(dist))
}
exports.default = parallel(gzip, brotli, imagemin);