Giter Site home page Giter Site logo

hello-gulp's Introduction

This is a brief introduction to Gulp, a front-end build system in NodeJS, that is fast, easy and fun to use.

The objective of this hands-on is to build the Bootstrap files to distribution and download, with aid of Gulp.

In the end, we will generate the final Boostrap structure, similar to the original:

dist/
├── js/bootstrap.js
├── js/bootstrap.min.js
│
├── css/bootstrap.css
├── css/bootstrap.less
│
└── fonts/**

build/
└── bootstrap.zip

Step-by-step

This tutorial is splitted into small steps that can be followed by the git tags:

$ git tag
0-init
1-install
2-simple-build
3-async-tasks
4-prod-build
5-copy-assets
6-zip
7-watcher
8-gruntfile

To get started checkout to the 0-init tag:

git checkout 0-init
git clean -dfx

Follow the changes to the files using git diff output:

$ git diff 0-init 1-install
diff --git a/gulpfile.js b/gulpfile.js
index e69de29..f42a67a 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -0,0 +1 @@
+var gulp = require('gulp');
diff --git a/package.json b/package.json
index aa6678e..daeb8b1 100644
--- a/package.json
+++ b/package.json
@@ -2,5 +2,6 @@
   "name": "hello-gulp",
   "version": "0.0.1",
   "devDependencies": {
+    "gulp": "~3.7"
   }
 }

The only files that change are gulpfile.js and package.json, so keep an eye on them.

Please notice that every time the package.json changes you will need to execute to fetch the dependecies with npm:

# Run every time package.json changes
npm install

Hint

To make easier to spot the diffs add some color to your git config:

git config --global color.diff "auto"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.