官术网_书友最值得收藏!

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:

  1. The Gulp executable can be configured in NetBeans IDE by selecting Tools | Options and choosing the HTML/JS and Gulp options:
  1. The following is the project structure once gulpfile.js is added:
  1. 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:
  1. Gulp tasks can be run via the project's context menu by right-clicking on the project as follows:
  1. We can also set the parameters, if needed, as follows:
  1. We can right-click on the project, select Gulp Tasks, and click the saved advanced option to invoke the target to execute as follows:
  1. 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.

主站蜘蛛池模板: 缙云县| 汉川市| 三江| 扶余县| 衡水市| 通辽市| 沭阳县| 彭泽县| 金乡县| 怀化市| 阿拉善左旗| 额尔古纳市| 南康市| 昔阳县| 拉孜县| 保定市| 新野县| 康乐县| 建平县| 金堂县| 平定县| 黎川县| 河北区| 宜州市| 客服| 海阳市| 大荔县| 满城县| 时尚| 突泉县| 黄山市| 砚山县| 天气| 浦县| 丹棱县| 麻阳| 南充市| 岑溪市| 苏尼特右旗| 湄潭县| 伊宁县|