yufan.me/themes/spectre/gulpfile.js

22 lines
538 B
JavaScript
Raw Normal View History

2024-06-14 02:15:18 +08:00
let gulp = require('gulp');
let cleanCSS = require('gulp-clean-css');
let uglify = require('gulp-uglify');
let rename = require("gulp-rename");
gulp.task('minify-js', () => {
return gulp.src('dist/**/*.js')
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('source'));
});
gulp.task('minify-css', () => {
return gulp.src('dist/**/*.css')
.pipe(rename({suffix: '.min'}))
.pipe(cleanCSS())
.pipe(gulp.dest('source'));
});
gulp.task('default', () => {
gulp.start('minify-js', 'minify-css');
});