标签:
var gulp = require(‘gulp‘); //语法检查 var jshint = require(‘gulp-jshint‘); // 合并 var concat = require(‘gulp-concat‘); // 压缩 var uglify = require(‘gulp-uglify‘); // 重命名 var rename = require(‘gulp-rename‘); gulp.task(‘minify‘, function(){ gulp.src(‘public/javascripts/main.js‘) .pipe(uglify()) .pipe(gulp.dest(‘build‘)) }) gulp.task(‘js‘, function(){ return gulp.src(‘public/javascripts/showpage.js‘) .pipe(jshint()) .pipe(jshint.reporter(‘default‘)) .pipe(uglify()) .pipe(concat(‘main.js‘)) .pipe(gulp.dest(‘build‘)) ; })
http://segmentfault.com/a/1190000002785647
匹配文件路径
js/app.js js/*.js js/**/*.js !js/app.js 除了 *.+(js|css) 以.js .css结尾 gulp.src([‘js/**/*.js‘, ‘!js/**/*.min.js‘]) 匹配多个
前端工具gulp的用途和使用方法 :http://blog.sina.com.cn/s/blog_6592d8070102vmuq.html
(很详细)前端构建工具gulpjs的使用介绍及技巧:www.cnblogs.com/2050/p/4198792.html
标签:
原文地址:http://www.cnblogs.com/wang-jing/p/4774003.html