-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
36 lines (32 loc) · 900 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
34
35
36
const { src, dest, parallel } = require('gulp');
const csso = require('gulp-csso');
const rename = require('gulp-rename');
const svgo = require('gulp-svgo');
const uglify = require('gulp-uglify');
function css() {
return src(['css/*.css', '!css/*.min.css'])
.pipe(csso({
comments: false,
restructure: false
}))
.pipe(rename({ suffix: '.min' }))
.pipe(dest('css'));
}
function js() {
return src(['js/*.js', '!js/*.min.js'])
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(dest('js'));
}
function svg() {
return src('images/*.svg')
.pipe(svgo({
multipass: true,
plugins: [{
sortAttrs: true,
inlineStyles: { onlyMatchedOnce: false }
}]
}))
.pipe(dest('images'));
}
exports.default = parallel(css, js, svg);