- Oracle JET for Developers
- Raja Malleswara Rao Pattamsetti
- 258字
- 2021-07-02 22:03:09
Installing Gulp
Gulp can be installed based on npm using the following command:
npm install --global gulp-cli
Once the Gulp installation is complete, a gulpfile.js configuration file should be generated in the project's Important Files folder in NetBeans IDE with its syntax looking like the following:
var gulp = require('gulp');
gulp.task('default', function() {
// place code for your default task here
});
Gulp can be executed as part of the command line using the gulp command, or made part of the NetBeans IDE commands as follows:
- The Gulp executable can be configured in NetBeans IDE by selecting Tools | Options and choosing the HTML/JS and Gulp options:

- The following is the project structure once gulpfile.js is added:

- Gulp tasks (clean, build, run, debug, and test both project and file, as highlighted in the following screenshot) can be assigned to common IDE actions by right-clicking on the project and selecting the Project Properties and Gulp options:

- Gulp tasks can be run via the project's context menu by right-clicking on the project as follows:

- We can also set the parameters, if needed, as follows:

- We can right-click on the project, select Gulp Tasks, and click the saved advanced option to invoke the target to execute as follows:

- Gulp output can be reviewed in the output window as the script is executed:

Gulp can be used in projects to help us save a lot of effort in repetitive tasks such as code optimization, minifying, programmatic testing, CSS preprocessing, and deploying to the targeted environment.
推薦閱讀
- 30天自制操作系統
- Containerization with LXC
- Linux Mint Essentials
- 白話區塊鏈
- 操作系統基礎與實踐:基于openEuler平臺
- 嵌入式實時操作系統μC/OS原理與實踐
- Linux系統安全基礎:二進制代碼安全性分析基礎與實踐
- 深入淺出Node.js
- RHCSARHCE 紅帽Linux認證學習指南(第7版)EX200 & EX300
- Social Data Visualization with HTML5 and JavaScript
- Cassandra 3.x High Availability(Second Edition)
- Windows 7實戰從入門到精通
- Windows 7實戰從入門到精通(超值版)
- iOS 10 開發指南
- Getting Started with Raspberry Pi Zero