Gulp

1 min. read

Gulp is an automation tool.

Introduction to Gulp

What is Gulp?
Gulp is an automation tool.

What is Gulp used for?
HTML has always broken the DRY Principle.

Automate uglify of JavaScript
Automate NodeJS
Copy files/folders from one location to another
Copy minify files
Include files
Browser Sync

How can Gulp be used in GameDev?

Use Cases of Gulp

Static Website

Let’s say you have a static website, which has a bunch of HTML, CSS, JS files. Each HTML file has a header, which is the same in each HTML file. Each time you make a change to the HTML file, you have to copy that change over. This is where gulp-file-include comes in, you can split your HTML page up into components like:
nav-component.html
header-component.html

Then in each HTML file where you want to use it, you just include the component as follows:
@@include(‘./nav-component.html’)

References

https://gulpjs.com/

YouTube Video Course:
https://www.youtube.com/watch?v=oRoy1fJbMls&list=PLriKzYyLb28lp0z-OMB5EYh0OHaKe91RV

https://gulpjs.com/docs/en/getting-started/javascript-and-gulpfiles

https://www.webstoemp.com/blog/switching-to-gulp4/

Gulp template:
https://gist.github.com/demisx/beef93591edc1521330a