mirror of
https://github.com/ZetaKebab/kesper.git
synced 2025-07-01 17:37:37 +00:00
Clean up build tasks
This commit is contained in:
43
gulpfile.js
43
gulpfile.js
@ -1,15 +1,10 @@
|
||||
var gulp = require('gulp');
|
||||
|
||||
// gulp plugins and utils
|
||||
var csscomb = require('gulp-csscomb');
|
||||
var del = require('del');
|
||||
var extReplace = require('gulp-ext-replace');
|
||||
var gutil = require('gulp-util');
|
||||
var livereload = require('gulp-livereload');
|
||||
var nodemon = require('gulp-nodemon');
|
||||
var postcss = require('gulp-postcss');
|
||||
var replace = require('gulp-replace');
|
||||
var svgmin = require('gulp-svgmin');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
// postcss plugins
|
||||
@ -27,16 +22,9 @@ var swallowError = function swallowError(error) {
|
||||
|
||||
var nodemonServerInit = function () {
|
||||
livereload.listen(1234);
|
||||
|
||||
return nodemon({
|
||||
ignore: ['gulpfile.js', 'assets/', 'public/', 'cachefiles/', 'locales/']
|
||||
}).on('restart', function () {
|
||||
gulp.src('app.js')
|
||||
.pipe(livereload());
|
||||
});
|
||||
};
|
||||
|
||||
gulp.task('build', ['css', 'icons'], function (/* cb */) {
|
||||
gulp.task('build', ['css'], function (/* cb */) {
|
||||
return nodemonServerInit();
|
||||
});
|
||||
|
||||
@ -57,37 +45,8 @@ gulp.task('css', function () {
|
||||
.pipe(livereload());
|
||||
});
|
||||
|
||||
gulp.task('comb', function () {
|
||||
return gulp.src('assets/css/**/*.css')
|
||||
.pipe(csscomb())
|
||||
.pipe(gulp.dest('assets/css/.'));
|
||||
});
|
||||
|
||||
gulp.task('clean:icons', function () {
|
||||
return del(['public/icons', 'views/partials/icons/*.hbs']);
|
||||
});
|
||||
|
||||
gulp.task('icons', ['clean:icons'], function () {
|
||||
gulp.src('assets/icons/**/*.svg')
|
||||
.pipe(replace(/#(?:[0-9a-f]{3}){1,2}/gi, 'currentColor'))
|
||||
.pipe(svgmin({
|
||||
plugins: [{
|
||||
removeDimensions: true
|
||||
}, {
|
||||
removeTitle: true
|
||||
}]
|
||||
}))
|
||||
.pipe(gulp.dest('public/icons'))
|
||||
.pipe(extReplace('.hbs'))
|
||||
.pipe(gulp.dest('views/partials/icons'))
|
||||
.on('end', function () {
|
||||
livereload.reload();
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('watch', function () {
|
||||
gulp.watch('assets/css/**', ['css']);
|
||||
gulp.watch('assets/icons/**/*.svg', ['icons']);
|
||||
});
|
||||
|
||||
gulp.task('default', ['build'], function () {
|
||||
|
Reference in New Issue
Block a user