-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
49 lines (37 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
var gulp = require('gulp-param')(require('gulp'), process.argv),
// concat = require('gulp-concat'),
//replace = require('gulp-replace'),
gutil = require('gulp-util'),
// gulpLog = require('gulp-log'),
rimraf = require('rimraf'),
sass = require('gulp-sass'),
path = require('path')
var paths = {
scss: [
'./sass/*.sass',
]
}
function handleSassError (err) {
gutil.log(gutil.colors.red('sass error\r\n'), gutil.colors.yellow(err.message))
this.emit('end')
}
gulp.task('del', function () {
return rimraf('./dist/static/*.*', function () {})
})
gulp.task('sass', function () {
return gulp.src(paths.scss)
.pipe(sass({
style: 'expanded',
//includePaths: [
//path.resolve(__dirname, './node_modules/bulma')
// ]
}))
.on('error', handleSassError)
.pipe(gulp.dest('./dist/static/css'))
//.pipe(gulp.dest('./demo/dist/static/css'))
})
gulp.task('sass-watch', ['sass'], function () {
gulp.watch([paths.scss], ['sass'])
})
gulp.task('build', [ 'sass'])
gulp.task('default', ['del', 'sass-watch'])