We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
他是基于nodejs的自动任务运行器,能够自动化的完成javascript/coffee/sass/less/html/imgage/css等文件的测试、检测、合并、压缩、格式化、浏览器自动刷新、部署文件的生成、并且监听改动后重复指定的这些步骤。在实现上,gulp借鉴了Unxi操作系统的管道(pipe)思想,前一级的输出,直接编程后一级的输入,使得在操作上十分简单。
gulp只介绍了四个API:task、dest、src、watch,除此之外,gulp还提供了一个run方法。
var gulp = require('gulp'), uglify = require("gulp-uglify"); gulp.task('minify-js', function () { gulp.src('js/*.js') // 要压缩的js文件 .pipe(uglify()) .pipe(gulp.dest('dist/js')); //压缩后的路径 });
gulp.task('rename', function () { gulp.src('js/jquery.js') .pipe(uglify()) //压缩 //会将jquery.js重命名为jquery.min.js .pipe(rename('jquery.min.js')) .pipe(gulp.dest('js')); });
// ps : 现在已经sprite-css已经没有在更新了,现在焦sprity,也新增了一些功能,下面这段代码只是作为展示实例 gulp.task('sprite-css', function(){ var DEST_NAME = args[1]; return gulp.src(`${WATCH_SRC}/**/*.png`) .pipe(spritesmith({ imgName: DEST_NAME + '.png', cssName: DEST_NAME + '.css', imgPath: '../images/' + DEST_NAME + '.png' })) .pipe(gulpif('*.png', gulp.dest('images/'))) .pipe(gulpif('*.css', gulp.dest('css/'))); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
关于Gulp
他是基于nodejs的自动任务运行器,能够自动化的完成javascript/coffee/sass/less/html/imgage/css等文件的测试、检测、合并、压缩、格式化、浏览器自动刷新、部署文件的生成、并且监听改动后重复指定的这些步骤。在实现上,gulp借鉴了Unxi操作系统的管道(pipe)思想,前一级的输出,直接编程后一级的输入,使得在操作上十分简单。
Gulp API
gulp只介绍了四个API:task、dest、src、watch,除此之外,gulp还提供了一个run方法。
常见插件
使用gulp实例 -- 雪碧图
The text was updated successfully, but these errors were encountered: