-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
51 lines (41 loc) · 1.35 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
50
51
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('gulp-bower');
var connect = require('gulp-connect');
var less = require('gulp-less');
gulp.task('less', function () {
gulp.src(['./src/less/app.less', './src/less/bootstrap.less'])
.pipe(less()) // should use paths: [ path.join(__dirname, 'src', 'includes') ]
.pipe(gulp.dest('./build/css'))
.pipe(connect.reload());
});
gulp.task('watch', function () {
// gulp.watch(['./src/**.html'], ['html']);
gulp.watch(['./src/less/*.less'], ['less']);
});
gulp.task('serve', ['watch'], function () {
connect.server({
root: ['./src', './build'],
livereload: true
});
});
gulp.task('jslib', function() {
gulp.src([
'./bower_components/bootstrap/dist/js/bootstrap.js',
'./bower_components/jquery/dist/jquery.js',
'./bower_components/underscore/underscore.js',
'./bower_components/highlight/src/highlight.js',
]).pipe(gulp.dest('./build/js/lib/'));
});
gulp.task('images', function () {
gulp.src(['./src/images/**'])
.pipe(gulp.dest('./build/images/'));
});
gulp.task('fonts', function () {
gulp.src(['./bower_components/bootstrap/dist/fonts/**', './src/fonts/**'])
.pipe(gulp.dest('./build/fonts/'));
});
gulp.task('build', ['images', 'fonts', 'less', 'jslib'], function() {
gulp.src('./src/*.html')
.pipe(gulp.dest('./build/'));
});