Gulp is a NODEJS-based automatic task runner that automates the testing, checking, merging, compressing, formatting, automatic browser refresh, and deployment file generation of JAVASCRIPT/COFFEE/SASS/LESS/HTML/IMAGE/CSS and other files. And listen for files that repeat the specified steps after the change. In the implementation, gulp borrowed from the UNIX operating system pipeline (pipe) thought, the previous level of output, directly into the back-level input, making it very simple to operate.
GULP Installation
Before installing Gulp, install node. js, and then install Gulp globally:
npm install -g gulp
After installation, you can detect the version of Gulp:
After you install gulp globally, you also need to install them separately in each project that you want to use Gulp. Switch the directory to your project folder and execute it on the command line:
npm install gulp
If you want to write gulp into the dependencies of the project Package.json file during installation, you can add –save-dev:
npm install gulp --save-dev
--save: The configuration information will be saved to Package.json (Package.json is the NODEJS project configuration file. Package.json is a normal JSON file and cannot add any comments. See HTTP://WWW.ZHIHU.COM/QUESTION/23004511);
-DEV/-DEP: Save to Package.json devdependencies node, do not specify-DEV/DEP will be saved to dependencies node.
After installing gulp, you can run NPM init to initialize the Package.json file:
It is important to note that name cannot contain uppercase letters:
After initialization, the Gulpfile.js file needs to be established at the root of the project, and the file name cannot be changed:
Gulp Study Notes (i)