Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is Gulp?

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The main content of this article is to explain "what is Gulp". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what Gulp is.

Gulp is a front-end automatic build tool based on NodeJS, which automatically completes repetitive tasks such as compiling, merging, compressing, syntax checking, browser automatic refresh of html/css/js/image/sass/less and other files in the process of project development. It uses stream (stream) in NodeJS in operation, imports it to the specified place through the pipe () method, and takes the output of the former level as the input of the latter level. Frequent IO operations are no longer required, but it should be noted that the stream content here is not the original file stream, but a virtual file object stream (VinylFiles), which stores the path, file name, content and other information of the original file.

NodeJS install Gulp

Gulp is based on NodeJS, so you need to install Node and npm package management tools. You can download the corresponding version of Node according to your operating system environment. | Downloads

After the download is completed, check whether the NodeJS is installed successfully through the command line. The command line of the Mac system is in the terminal (Terminal), and the command line of the Windows system can be run by entering cmd through window+r.

After the command line is started, you can view the NodeJS and npm version numbers by entering the commands node-v and npm-v, respectively. Displaying the version number is a successful installation.

Npm introduces Gulp

Npm (NodePackageManager) is a package management tool installed with NodeJS for node plug-in management, including plug-in installation, uninstallation, management dependencies, etc.

Execute the npminstall [- g] [--save-dev] command from the command line to install the plug-in using npm

Is the node plug-in name

-g is a global installation, and the global installation can call the plug-in anywhere through the command line, while the non-global installation will only be installed under the node_modules folder of the current location directory and called through the require () method.

-- save saves the configuration information to the NodeJS project configuration file package.json

-dev saves configuration information to the devDependencies node under the package.json file

Once we have the package.json configuration information, we can download all the plug-in packages in the package.json configuration information with one click through the npminstall command

If you need to delete the plug-in package, execute the npmuninstall [- g] [--save-dev] command instead of deleting the local plug-in package directly. With the help of rimraf, you can delete all plug-in packages. After installing rimraf by command npminstallrimraf-g, execute the rimrafnode_modules command.

At this point, I believe you have a deeper understanding of "what Gulp is", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report