Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
gulpfile.js 744 Bytes
Copy Edit Raw Blame History
//install first: npm install gulp gulp-uglify gulp-clean-css gulp-rename --save-dev
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
cleancss = require('gulp-clean-css'),
rename = require('gulp-rename');
//compress js code
gulp.task('minifyjs', function() {
return gulp.src('src/*.js').pipe(rename({suffix:'.min'})).pipe(uglify()).pipe(gulp.dest('dist'));
});
//compress css code
gulp.task('minifycss', function() {
gulp.src(['src/css/*.gif', 'src/css/*.png']).pipe(gulp.dest('dist/css'));
return gulp.src('src/css/*.css')
.pipe(rename({suffix:'.min'}))
.pipe(cleancss())
.pipe(gulp.dest('dist/css'));
});
gulp.task('default', function() {
gulp.start('minifyjs');
gulp.start('minifycss');
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化