-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
40 lines (33 loc) · 1.05 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
/**
* Popular Tasks
* -------------
*
* compile: compiles the .less files of the specified packages
* lint: runs jshint on all .js files
*/
var gulp = require('gulp'),
header = require('gulp-header'),
less = require('gulp-less'),
rename = require('gulp-rename');
// banner for the css files
var banner = "/*! <%= data.title %> <%= data.version %> | (c) 2014 Pagekit | MIT License */\n";
gulp.task('default', ['compile']);
/**
* Compile all less files
*/
gulp.task('compile', function () {
return gulp.src('less/theme.less', {base: __dirname})
.pipe(less({compress: true}))
.pipe(header(banner, { data: require('./package.json') }))
.pipe(rename(function (file) {
// the compiled less file should be stored in the css/ folder instead of the less/ folder
file.dirname = file.dirname.replace('less', 'css');
}))
.pipe(gulp.dest(__dirname));
});
/**
* Watch for changes in files
*/
gulp.task('watch', function () {
gulp.watch('less/*.less', ['compile']);
});