First, Introduction
Gulp is a front-end build tool and a build tool similar to grunt, but gulp is lighter, more simple to configure and use, less commands, easier to learn and remember than grunt.
Second, the specific use
- Install GULP:NPM Install-g Gulp (Global installation), NPM install--save-dev Gulp (as a dependency on the development project, gulp information is written in devdependenices);
- Create a gulpfile.js file in the root directory of the project.
- Specific use: First the package to be used to import, and then create a task, for the files that need to be processed to do the appropriate action, and then stored in the specified directory;
Add the appropriate package method: NPM Install Gulp-jshint--save-dev or NPM install Gulp--save or NPM installed Gulp-jshint, all three can be Gulp-jshint installation success, but the difference is --save-dev updates the installed package information to the Devdependenices section in Package.json, and-- Save will write the package information directly into the Package.json dependenices section without adding the package information into the Package.json. At run time, using the command: Gulp, only the default task is executed, no other tasks are performed, and to perform other tasks you need to use the command Gulp [name name] to represent the task executing the specified name; Shows the contents of a Gulpfile.js file:
The following directories are available in the post-execution catalog:
More details can be found in Gulp Chinese web: http://www.gulpjs.com.cn/
Use of Gulp