notebook/gulpfile.js

32 lines
818 B
JavaScript
Raw Normal View History

2015-04-15 05:35:43 +08:00
var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');
var minifyCSS = require('gulp-minify-css');
var rename = require('gulp-rename');
2015-04-16 05:32:16 +08:00
var sourcemaps = require('gulp-sourcemaps');
// now some dev nice utilities.
var livereload = require('gulp-livereload');
2015-04-15 05:35:43 +08:00
2015-04-16 05:32:16 +08:00
gulp.task('css', function () {
2015-05-14 01:56:32 +08:00
return gulp.src('./notebook/static/style/*.less')
2015-04-16 05:32:16 +08:00
.pipe(sourcemaps.init())
2015-04-15 05:35:43 +08:00
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(minifyCSS({restructuring: false}))
2015-04-15 05:35:43 +08:00
.pipe(rename({
suffix: '.min'
}))
2015-04-21 03:15:05 +08:00
.pipe(sourcemaps.write('./'))
2015-05-14 01:56:32 +08:00
.pipe(gulp.dest('./notebook/static/style'))
.pipe(livereload());
2015-04-15 05:35:43 +08:00
});
2015-04-16 05:32:16 +08:00
gulp.task('watch', function() {
livereload.listen();
2015-05-14 01:56:32 +08:00
gulp.watch('notebook/static/**/*.less', ['css']);
});