Gulp使用指南
来源:互联网 发布:sd卡数据修复 编辑:程序博客网 时间:2024/06/06 12:31
Gulp简介
The streaming build system.
基于流的构建工具,作用是
Automate and enhance your workflow.
构建工具
有点高大上,就是在(前端)开发过程中做一些任务,请看本文Gulp插件
部分。
有同样作用的还有Grunt
,但Gulp
更好且更简单。
开始使用
全局安装
npm install -g gulp
安装到项目的 devDependencies
npm install --save-dev gulp
在项目根目录创建 gulpfile.js 文件
var gulp = require('gulp');gulp.task('default', function() { // place code for your default task here});
运行 gulp
gulp
默认的名为 default 的任务(task)将会被运行,在这里,这个任务并未做任何事情
想要单独执行特定的任务(task)gulp <task> <othertask>
流
Gulp是基于流的,流
听上去有点高大上。数据流能够通过一系列的小函数来传递数据,这些函数会对数据进行修改,然后把修改后的数据传递给下一个函数。
gulp API
gulp只有极少的API,只4个函数
- gulp.src(globs[, options])
- gulp.dest(path[, options])
- gulp.task(name[, deps], fn)
- gulp.watch(glob [, opts], tasks) or gulp.watch(glob [, opts, cb])
详情点这里
Gulp插件
Gulp本身不能完成很多任务,需要依赖插件。
常用插件:
gulp-jshint JSHint plugin for gulp,侦测javascript代码中错误和潜在问题
0 0
- Gulp使用指南
- Gulp使用指南
- Gulp 使用指南
- gulp使用指南
- gulp基本使用指南
- 前端自动化构建工具gulp使用指南
- gulp
- Gulp
- gulp
- Gulp
- gulp
- gulp
- gulp
- gulp
- gulp
- gulp
- gulp
- Gulp
- TEST 1#
- 二分查找
- C/C++常用宏定义
- Form表单中的action提交路径问题
- C++中struct和class的区别
- Gulp使用指南
- ftp与sftp连接实例
- How to Support 3D Touch - Static Action on Xcode6
- Android基础入门教程——8.1.2 Android中的13种Drawable小结 Part 2
- Code Forces 581 C. Developing Skills(贪心)
- C++primer第五版笔记-第九章顺序容器
- DBus 进程间的通信
- LeetCode-Invert Binary Tree
- hdu 1423 Greatest Common Increasing Subsequence 最长公共上升子序列