-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (40 loc) · 1.34 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');
var sass = require('gulp-sass');
var server = require('gulp-server-livereload');
var config = {
bootstrapDir: './client/assets/libs/bootstrap-sass',
publicDir: './client/assets',
};
gulp.task('build-css', function() {
gulp.src('client/assets/sass-bootstrap-custom/app.sass')
.pipe(sass({
includePaths: [config.bootstrapDir + '/assets/stylesheets']
}))
.pipe(gulp.dest(config.publicDir + '/css/'));
});
gulp.task('fonts', function() {
return gulp.src(config.bootstrapDir + '/assets/fonts/**/*')
.pipe(gulp.dest(config.publicDir + '/fonts'));
});
gulp.task('build-additional-css', function() {
gulp.src('client/assets/sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./client/assets/css/'));
});
//Watch task
gulp.task('watch-main',['build-css'], function() {
gulp.watch('client/assets/sass-bootstrap-custom/**/*.scss',['build-css']);
});
gulp.task('watch', ['build-additional-css'], function() {
gulp.watch('client/assets/sass/**/*.scss',['build-additional-css']);
});
gulp.task('webserver', function() {
gulp.src('client')
.pipe(server({
livereload: true,
// directoryListing: true,
open: true,
defaultFile: 'index.html'
}));
});
gulp.task('default', ['fonts', 'watch-main', 'watch', 'webserver']);