Gulp Part 01



In this article I'm going to discuss about one of the most popular angular Build Tool which is called Gulp.

Component of modern front-end workflow

  • npm: a programming library and package manager for Node.js and JavaScript (Node environment dev dependencies).
  • yarn: A package manager for JavaScript.
  • Bower: a package manager for the front-end dependencies .
  • Chocolatey: Open-source decentralized package manager for Windows.

Package Managers

Automate packages and libraries that use in dev environment.
  • Installation
  • Upgrading 
  • Remove
  • Dependencies

What is build tool

Collection of tasks that automate repetitive work.

Why we need a build tool

It helps to automate build processes. In general,mainly 4 things that can be automated by a build tool
  • Development
  • Testing
  • Optimization and
  • Deployment
Present, there are so many build tools available for angular.Out of them the two most popular build tools are Gulp and Grunt. In this article I am discussing about Gulp

Differences between Grunt and Gulp

There are two main differences between Grunt and Gulp
  • The way configure your tasks
    • Grunt is configuration-based. 
    • Gulp is stream-based.
  • The way they run your tasks. 
    • Grunt runs the processes you want to execute in a sequential manner.
    • Gulp tries to run them with maximum concurrency, meaning it will try to execute processes in parallel if possible

Gulp

Gulp is JavaScript tasks runner built on Node.js 
  • generating HTML from templates and content files
  • compressing images
  • compiling Sass to CSS code
  • removing console and debugger statements from scripts
  • concatenating and minifying CSS and JavaScript files
  • deploying files to development, staging and production servers

There are three main Gulp commands:

  • gulp.task – defines a new task with a name, optional array of dependencies and a function.
  • gulp.src – sets the folder where source files are located.
  • gulp.dest – sets the destination folder where build files will be placed.

The pipe() use for copy files from one folder to another.

In my next article,I will discuss about Gulp installation and package.json

Comments

Popular posts from this blog

Installing Gulp and Package.json

Why and How performance is important

Basic concepts of Blockchain