gulp 合并、压缩、重命名js文件

var gulp = require('gulp');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var usemin = require('gulp-usemin');
var minifyCss = require('gulp-minify-css');
var minifyHtml = require('gulp-minify-html');
var rev = require('gulp-rev');
var del = require('del');

// lint JS,静态检查js语法错误
gulp.task('lint', function(){
    return gulp.src('js/**/*.js')

// Concat & Minify JS,合并压缩重命名js
gulp.task('minify', function(){
return gulp.src('js/*.js')

// clean,清理输出目录
gulp.task('clean', function(){
    return del('dist/*');


   path.basename += '.min';
   path.extname = '.js'; 


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.