notebook/gulpfile.js
Matthias Bussonnier 69d86dccc7 Configure watch/livereload extension and document it.
Is usefull mostly for css, but will be for typscript too.
2015-04-21 18:30:05 -07:00

32 lines
820 B
JavaScript

var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');
var minifyCSS = require('gulp-minify-css');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
// now some dev nice utilities.
var livereload = require('gulp-livereload');
gulp.task('css', function () {
return gulp.src('./jupyter_notebook/static/style/*.less')
.pipe(sourcemaps.init())
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(minifyCSS())
.pipe(rename({
suffix: '.min'
}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./jupyter_notebook/static/style'))
.pipe(livereload());
});
gulp.task('watch', function() {
livereload.listen();
gulp.watch('jupyter_notebook/static/**/*.less', ['css']);
});