-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
executable file
·46 lines (40 loc) · 1.08 KB
/
gulpfile.babel.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
import gulp from 'gulp'
import watch from 'gulp-watch'
import plumber from 'gulp-plumber'
import svgmin from 'gulp-svgmin'
import svgsprite from 'gulp-svg-sprite'
gulp.task('svg', () => {
gulp.src('src/svg/*.svg')
.pipe(svgmin({ plugins: [
{ convertStyleToAttrs: true },
{ removeTitle: true },
{ removeStyleElement: true },
{ removeAttrs: { attrs: 'id|class' } },
{ removeDimensions: true },
{ removeUselessDefs: true }
] }))
.pipe(svgsprite({
mode: {
symbol: {
dest: './',
sprite: 'icons.svg'
}
}
}))
.pipe(gulp.dest('build/assets'))
})
gulp.task('html', () => {
gulp.src('src/html/*.html').pipe(gulp.dest('build'))
})
gulp.task('html:watch', () => {
watch('src/html/**/*', () => gulp.start('html'))
})
gulp.task('css', () => {
gulp.src('src/css/*.css').pipe(gulp.dest('build/css'))
})
gulp.task('css:watch', () => {
watch('src/css/**/*', () => gulp.start('css'))
})
gulp.task('build', ['html', 'css'])
gulp.task('watch', ['html:watch', 'css:watch'])
gulp.task('dev', ['build', 'watch'])