-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (29 loc) · 971 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
import gulp from 'gulp'
import sass from 'gulp-sass'
const scssPath = 'client/assets/scss'
const cssPath = 'client/assets/css'
const compPath = 'client/src/components'
const semanticSassIconsPath = './node_modules/semantic-ui-sass/icons'
gulp.task('sass', function() {
return gulp.src(scssPath + '/style.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(cssPath))
})
gulp.task('replace-fonts', function(){
return gulp.src(semanticSassIconsPath + '/*.{eot,svg,ttf,woff,woff2}')
.pipe(gulp.dest('./client/dist/fonts'))
})
gulp.task('watch-sass', function() {
gulp.watch([
scssPath + '/meta/*',
scssPath + '/theme/*',
scssPath + '/common/*',
scssPath + '/semantic/*',
scssPath + '/common.scss',
scssPath + '/style.scss',
compPath + '/**/*.scss'
], [ 'sass' ])
// throws an error when use
// gulp.watch([ scssPath + '/**/*' ], [ 'sass' ])
})
gulp.task('default', [ 'replace-fonts', 'watch-sass' ])