flex/gulpfile.js

54 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2015-07-19 02:20:09 +02:00
var gulp = require('gulp'),
less = require('gulp-less'),
rename = require('gulp-rename'),
cssnano = require('gulp-cssnano'),
uglify = require('gulp-uglify');
2015-07-19 02:20:09 +02:00
gulp.task('less', function () {
return gulp.src([
'./static/stylesheet/dark-theme.less',
'./static/stylesheet/style.less',
])
2015-07-19 02:20:09 +02:00
.pipe(less())
.pipe(cssnano())
2015-10-07 02:19:34 +02:00
.pipe(rename({
extname: '.min.css'
}))
.pipe(gulp.dest('./static/stylesheet'));
2015-07-19 02:20:09 +02:00
});
gulp.task('uglify', function () {
2020-04-20 22:56:30 +02:00
return gulp.src('./static/dark-theme/dark-theme.js')
.pipe(uglify())
.pipe(rename({
extname: '.min.js'
}))
2020-04-20 22:56:30 +02:00
.pipe(gulp.dest('./static/dark-theme'));
});
2016-04-23 08:14:54 +02:00
gulp.task('cp', function () {
return gulp.src('./node_modules/font-awesome/**/*.{min.css,otf,eot,svg,ttf,woff,woff2}')
.pipe(gulp.dest('./static/font-awesome'));
});
2016-04-24 00:44:16 +02:00
gulp.task('pygments', function () {
return gulp.src(['./static/pygments/*.css', '!./static/pygments/*min.css'])
.pipe(cssnano())
2016-04-24 00:44:16 +02:00
.pipe(rename({
extname: '.min.css'
}))
.pipe(gulp.dest('./static/pygments'));
});
2020-05-12 15:15:39 +02:00
gulp.task('watch-less', function () {
return gulp.watch('static/stylesheet/*.less', gulp.task('less'));
});
gulp.task('watch-js', function () {
return gulp.watch('static/dark-theme/!(*.min).js', gulp.task('uglify'));
})
2016-04-24 00:44:16 +02:00
gulp.task('default', gulp.series(['less', 'uglify', 'cp', 'pygments']));
2020-05-12 15:15:39 +02:00
gulp.task('watch', gulp.series('default', gulp.parallel('watch-less', 'watch-js')));