Use the -g options to install Gulp globally on your machine. With Gulp.js everything happens on the fly using Node’s stream, temporary files are not needed anymore which make it easy to learn, use and enjoy. Biasanya digunakan untuk mengeksekusi task automasi seperti: Minify dan optimasi file HTML, CSS, Javascript Kompilasi file SASS Menjalankan Web Server Me-reload server secara otomatis Build dan deploy project dan lain sebagainya. It means that a typical Cakefile or Grunt workflow would be to execute a task that dumps a temporary file, than based on this file to execute another task that dumps another temporary file an so on… Gulp adalah sebuah build tool yang dibuat dengan Nodejs 1. While Cakefile or Grunt use files to execute tasks, Gulp.js uses streams. I would say it is no better nor worse than Grunt or Cakefile, it is different. It can be installed by using npm as shown in the following command. Today the Web automation ecosystem is dominated by Grunt.js (which is a great tool BTW) but lately Gulp.js is getting more trending and soon will be overtaking Grunt.js (according to the GitHub popularity, aka “stars”: 7900 for Grunt.js and 6250 for Gulp.js). Let's take one plugin called minify-css to merge and minify all CSS scripts. Have to run gulp more than once to get Style changes. Accessing home directory with base in Gulp. Gulp-sass wont compile scss files to css instead copy all files from scss folder to css folder. Gulp.js does not revolutionize automation but simplifies it tremendously. Gulp-minify-css does not produce output files. Put the following in your gulpfile. This is where you will define your Gulp tasks, which will be run using the gulp command. It helps you automate repetitive tasks such as minification, compilation, unit testing, linting, etc. Gulp is a very powerful JavaScript build tool that can help automate some of the more tedious, but important, aspects of building your project. Let’s create a task to minify one of our JavaScript files.
Gulp.js is what we call a JavaScript Task Runner, it is Open Source and available on GitHub.