GULP JS -Web Developer Best Practice
Hi Spiderman, Is it sound fancy??? I’m saying with reason. Yes you are a Spiderman if you are a web developer.
Development Code VS Production Code :
Every site should have a development version and a production version of code. The development version has all the HTML, CSS, JS and image files that make up your site in a clean format that you are happy to work on.
A production version will take these files, minify them, concatenate / merge them and optimize files.
GULP: Gulp is a Task / Build runner. It will simplify the works for developers.
What Is a Build Process? A build process is a set of tasks which runs over your projects files, by compiling and testing the code during development and used to create the deployment version of your site.
What Tasks Should be in a Build Process
In the following sections, we’re going to look at the most common tasks you should have it in your build process and recommended tasks for Grunt and Gulp.
• Use Concatenation & Minification for a Faster Site
For those who are unfamiliar with the terms concatenation and minification, concatenation means simply merging multiple files together, i.e. copying and pasting several files into one. The reason we do this is because, it’s more efficient for a browser to fetch one file, rather than fetching a bulk of small files.
Minification is the process of fetching a file and lessens the overall number of characters, without changing the actual working of the code.
A good example of this is by removing the comments, or a long variable name by making it shorter. This makes the file size smaller, leading to faster download.
• Optimize Your Images
Image optimization is an important step that helps to speed up your site; you’d be surprised ,how much smaller you can make an image without losing quality. Meta data is removed from the image as it’s not needed by the browser to display the image, for example, information about the camera used to take the photo.
keep calm and visit GUVI Blogs for upcoming post on GULP JS…