-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathgulpfile.js
51 lines (46 loc) · 1.12 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
/**
* Gulp Modules.
*/
var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');
var del = require('del');
var cssmin = require('gulp-cssmin')
/**
* Set path to resources directory.
*/
var resources = './resources/';
/**
* Remove old generated content.
*/
gulp.task('clean', function(cb) {
del(['public/*'], cb);
});
/**
* Compile LESS stylesheets to CSS.
*/
gulp.task('less', function () {
gulp.src(resources + 'less/default.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(cssmin().on('error', function(err) {
console.log(err);
}))
.pipe(gulp.dest('public/'));
gulp.src(resources + 'fonts/*').pipe(gulp.dest('public/fonts/'));
gulp.src(resources + 'img/*').pipe(gulp.dest('public/img/'));
});
/**
* Move static assets.
*/
gulp.task('move', function () {
gulp.src(resources + 'fonts/*').pipe(gulp.dest('public/fonts/'));
gulp.src(resources + 'img/*').pipe(gulp.dest('public/img/'));
});
/**
* Default Gulp Task.
*/
gulp.task('default', ['clean'], function() {
gulp.start('less', 'move');
});