This repository has been archived by the owner on Jan 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
76 lines (63 loc) · 1.78 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('gulp-bower');
var connect = require('gulp-connect');
var less = require('gulp-less');
var jasmine = require('gulp-jasmine');
gulp.task('tests', function () {
return gulp.src('tests/*.js')
.pipe(jasmine());
});
gulp.task('bower', function() {
return bower();
});
gulp.task('install', ['bower'], function() {
var bc = 'bower_components',
files = [
bc + '/jquery/dist/jquery.js',
bc + '/bootstrap/dist/js/bootstrap.js'
];
return gulp.src(files)
.pipe(gulp.dest('./dist/js/'));
});
gulp.task('serve', ['default', 'watch'], function () {
connect.server({
port: process.env.PORT || 8080,
root: './dist',
livereload: true
});
});
gulp.task('html', function () {
console.log("html updated");
gulp.src('./src/**.html')
.pipe(gulp.dest('./dist/'))
.pipe(connect.reload());
});
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('./dist/css'))
.pipe(connect.reload());
});
gulp.task('js', function () {
gulp.src('./src/js/*.js')
.pipe(gulp.dest('./dist/js'))
.pipe(connect.reload());
});
gulp.task('images', function () {
gulp.src('./src/images/*')
.pipe(gulp.dest('./dist/images'))
.pipe(connect.reload());
});
gulp.task('favicon', function() {
gulp.src('./src/favicon.ico')
.pipe(gulp.dest('./dist'));
});
gulp.task('watch', function () {
gulp.watch(['./src/**.html'], ['html']);
gulp.watch(['./src/less/*.less'], ['less']);
gulp.watch(['./src/js/*.js'], ['js']);
gulp.watch(['./src/images/*'], ['images'])
});
gulp.task('default', ['less', 'html', 'js', 'images'], function(){
});