This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
forked from greenwoodents/khanova-skola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
60 lines (51 loc) · 1.47 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
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var path = require('path');
var lessDir = './less';
var lessFiles = path.join(lessDir, '*', '**');
var lessMainFile = path.join(lessDir, 'main.less');
var cssDir = './css';
gulp.task('less', function () {
gulp.src(lessMainFile)
.pipe($.sourcemaps.init())
.pipe($.less())
.pipe($.autoprefixer())
.pipe($.rename({suffix: '.min'}))
.pipe($.sourcemaps.write('.', {
sourceRoot: '../less'
}))
.pipe(gulp.dest(cssDir))
.pipe($.livereload());
});
var bootstrapLessDir = [
'./bower_components/bootstrap/less/*',
'./bower_components/bootstrap/less/**/*'
];
gulp.task('bower', function () {
//jQuery
gulp.src('./bower_components/jquery/dist/jquery.min.js')
.pipe(gulp.dest('./js'));
//Bootstrap LESS
gulp.src(bootstrapLessDir)
.pipe(gulp.dest('./less/bootstrap'));
//Bootstrap JS
gulp.src('./bower_components/bootstrap/dist/js/bootstrap.min.js')
.pipe(gulp.dest('./js'));
});
gulp.task('production', function () {
gulp.src(lessMainFile)
.pipe($.less())
.pipe($.autoprefixer())
.pipe($.cssmin())
.pipe($.rename({suffix: '.min'}))
.pipe(gulp.dest(cssDir));
});
gulp.task('default', function() {
gulp.start('less', 'bower');
});
gulp.task('watch', ['less'], function() {
//Watch changes (less, )
gulp.watch('less/*.less', ['less']);
gulp.watch('less/**/**.less', ['less']);
gulp.watch('*.html', ['less']);
});