SlideShare a Scribd company logo
Angular Workflow with 
Gulp.js 
Cihad Horuzoğlu
Cihad Horuzoğlu 
Front-end & Mobile Developer @ CicekSepeti.com 
@cihadhoruzoglu 
http://cihadhoruzoglu.com
Think your Work Flow
Work Flow 
Develop Build 
● Non minified 
● Seperated files 
● Test configuration 
● Compiling 
● Test code 
● Watchers 
● Live reload 
● Linting 
● Minified 
● Merged files 
● Live configuration 
● Compiled 
● Renamed 
● Optimize performance 
● Deployment 
Setup 
● Download dependencies 
● Download framework 
● Download libraries
Don’t do it manually, 
Automate it!
Angular workflow with gulp.js
Use front-end tools
Angular workflow with gulp.js
What is the difference 
between Grunt & Gulp ?
Gulp vs Grunt 
Gulp 
● Code over configuration 
● Easy to read & use 
● Based on streams 
Grunt 
● Configuration over code 
● Hard to read 
● Based on files
How these works?
Grunt 
Gulp Much faster
The streaming build 
system
Angular workflow with gulp.js
Sample Stream 
gulp.src('app/js/main.js') 
.pipe(jshint()) 
.pipe(uglify()) 
.pipe(concat()) 
.pipe(gulp.dest('build'))
Getting started with Gulp
Install gulp Create 
gulpfile.js 
Install 
dependent 
packages 
Write tasks to 
your gulp file 
Run your gulp 
tasks 
Using gulp
Install Gulp 
Globally Install 
$ npm install -g gulp 
Install as a dependency to your project 
$ npm install gulp --save-dev
Create gulpfile.js 
var gulp = require(gulp); 
gulp.task('default', function() { 
// place code for your default task here 
});
Run via Terminal 
$ gulp (runs default task) 
$ gulp minify concat (runs multiple task) 
$ gulp watch (runs watch task)
Gulp API
gulp.task(name[, deps], fn) 
gulp.task('js', function() { 
gulp.src('app/js/main.js') 
.pipe(uglify()) 
.pipe(concat()) 
.pipe(gulp.dest('build')) 
}); 
Registers a task name with 
a function
gulp.src(globs[, options]) 
gulp.src('app/css/*.less') 
.pipe(less()) 
.pipe(concat('main.css')) 
.pipe(gulp.dest('public/css)) 
Takes a file system glob 
and starts emitting files that 
match.
gulp.dest(path[, options]) 
gulp.src('app/index.html') 
.pipe(gulp.dest('public/html')) Piped files are written to the 
file system
gulp.watch(glob[, opts], tasks) 
gulp.task('watch', function() { 
gulp.watch(['./js/**/*.js'], ['js']); 
}); 
Run a function when glob 
change
That’s it. 
Gulp has just 4 function.
Let’s discover some plugins
Common Gulp Plugins 
$ npm install 
● gulp-minify-css 
● gulp-uglify 
● gulp-concat 
● gulp-ng-annotate 
● gulp-ngdocs 
● gulp-ng-html2js
gulp-minify-css 
var minifyCSS = require('gulp-minify-css'); 
gulp.task('minify-css', function() { 
gulp.src('./static/css/*.css') 
.pipe(minifyCSS({keepBreaks: true})) 
.pipe(gulp.dest('./dist/')) 
});
gulp-uglify 
var uglify = require('gulp-uglify'); 
gulp.task('compress', function() { 
gulp.src('lib/*.js') 
.pipe(uglify()) 
.pipe(gulp.dest('./dist/')) 
});
gulp-concat 
var concat = require('gulp-concat'); 
gulp.task('scripts', function() { 
gulp.src('./lib/*.js') 
.pipe(concat('all.js')) 
.pipe(gulp.dest('./dist/')) 
});
What about Angular 
plugins ?
gulp-ng-annotate 
var ngAnnotate = require('gulp-ng-annotate'); 
gulp.task('default', function () { 
gulp.src('src/app.js') 
.pipe(ngAnnotate()) 
.pipe(gulp.dest('dist')); 
});
gulp-ng-docs 
var gulpDocs = require('gulp-ngdocs'); 
gulp.task('ngdocs', function () { 
gulp.src('path/to/src/*.js') 
.pipe(gulpDocs.process()) 
.pipe(gulp.dest('./docs')); 
});
gulp-nghtml2js 
var ngHtml2Js = require("gulp-ng-html2js"); 
gulp.task("./partials/*.html") 
.pipe(ngHtml2Js({ 
moduleName: "MyAwesomePartials", 
prefix: "/partials" 
})) 
.pipe(gulp.dest("./dist/partials"));
Demo Time
Questions
Thanks. 
Follow us 
@cihadhoruzoglu 
@techciceksepeti

More Related Content

What's hot (20)

PDF
Gulp - the streaming build system
Sergey Romaneko
 
ODP
GulpJs - An Introduction
Knoldus Inc.
 
PDF
Frontend JS workflow - Gulp 4 and the like
Damien Seguin
 
PDF
Automating your workflow with Gulp.js
Bo-Yi Wu
 
PPTX
JavaScript code academy - introduction
Jaroslav Kubíček
 
PDF
Devenez le plus heureux des Front-end avec Gulp.js
Rémy Savard
 
PDF
Front-end development automation with Grunt
benko
 
PPTX
Grunt - The JavaScript Task Runner
Mohammed Arif
 
PPTX
Grunt to automate JS build
Tejaswita Takawale
 
ODP
What grunt?
Lucio Martinez
 
PPTX
Gulp and bower Implementation
Prashant Shrestha
 
PDF
Automating Large Applications on Modular and Structured Form with Gulp
Anderson Aguiar
 
PDF
JVM Web Frameworks Exploration
Kevin H.A. Tan
 
PDF
Groovy on Google App Engine with Gaelyk
Kevin H.A. Tan
 
PDF
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
tdc-globalcode
 
PDF
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
DrupalCamp Kyiv
 
PDF
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Max Andersen
 
PDF
Develop - Project Scaffolding
Kevin Cao
 
PDF
Modern infrastructure as code with ansible cake fest 2021
Joe Ferguson
 
Gulp - the streaming build system
Sergey Romaneko
 
GulpJs - An Introduction
Knoldus Inc.
 
Frontend JS workflow - Gulp 4 and the like
Damien Seguin
 
Automating your workflow with Gulp.js
Bo-Yi Wu
 
JavaScript code academy - introduction
Jaroslav Kubíček
 
Devenez le plus heureux des Front-end avec Gulp.js
Rémy Savard
 
Front-end development automation with Grunt
benko
 
Grunt - The JavaScript Task Runner
Mohammed Arif
 
Grunt to automate JS build
Tejaswita Takawale
 
What grunt?
Lucio Martinez
 
Gulp and bower Implementation
Prashant Shrestha
 
Automating Large Applications on Modular and Structured Form with Gulp
Anderson Aguiar
 
JVM Web Frameworks Exploration
Kevin H.A. Tan
 
Groovy on Google App Engine with Gaelyk
Kevin H.A. Tan
 
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
tdc-globalcode
 
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
DrupalCamp Kyiv
 
Case study: JBoss Developer Studio, an IDE for Web, Mobile and Cloud applicat...
Max Andersen
 
Develop - Project Scaffolding
Kevin Cao
 
Modern infrastructure as code with ansible cake fest 2021
Joe Ferguson
 

Viewers also liked (20)

PDF
Hybrid Apps with Angular & Ionic Framework
Cihad Horuzoğlu
 
PDF
Modern Frontend
Cihad Horuzoğlu
 
PDF
Native vs. Hybrid Applications
Cihad Horuzoğlu
 
PPTX
Evaluation question 4
vishalpanwar12
 
PPTX
ffvgggggggggggggggggggggggggggggggggggggg
Miguel Sepulveda
 
PPT
Presentation1
arandiamarygraziah
 
PPTX
MRI NO2 Black Full Cycle
Luis Green
 
PPTX
novenyvedoszerek
Bálint Tilinger
 
PDF
From reactive to proactive - How Azur transformed a service helpdesk and boos...
Azur Global
 
PPT
Baker & daniels interview questions answers
JurgenKlinsman14
 
PPTX
Red Hot Red RimPro-Tec's
RimPro-Tec Wheel Bands
 
PPTX
Презинтація Щербак Ю.
Юлия Щербак
 
PPTX
Project Planning
Ila Lee
 
PPTX
¿Suerte o Esfuerzo?
Miguel Ayasta
 
PDF
Oszastowski przydatność utworzenia numerycznego modelu terenu (nmt) dla teren...
Michał Oszastowski
 
PPTX
ALLMAX Nutrition CLA95
Luis Green
 
PPTX
Shelfariinstructions
z8850
 
PPTX
Cristian lizarazo
Cristian Lizarazo
 
PPTX
Evaluation 4
imicki
 
PPTX
Process mapping
kma0209
 
Hybrid Apps with Angular & Ionic Framework
Cihad Horuzoğlu
 
Modern Frontend
Cihad Horuzoğlu
 
Native vs. Hybrid Applications
Cihad Horuzoğlu
 
Evaluation question 4
vishalpanwar12
 
ffvgggggggggggggggggggggggggggggggggggggg
Miguel Sepulveda
 
Presentation1
arandiamarygraziah
 
MRI NO2 Black Full Cycle
Luis Green
 
novenyvedoszerek
Bálint Tilinger
 
From reactive to proactive - How Azur transformed a service helpdesk and boos...
Azur Global
 
Baker & daniels interview questions answers
JurgenKlinsman14
 
Red Hot Red RimPro-Tec's
RimPro-Tec Wheel Bands
 
Презинтація Щербак Ю.
Юлия Щербак
 
Project Planning
Ila Lee
 
¿Suerte o Esfuerzo?
Miguel Ayasta
 
Oszastowski przydatność utworzenia numerycznego modelu terenu (nmt) dla teren...
Michał Oszastowski
 
ALLMAX Nutrition CLA95
Luis Green
 
Shelfariinstructions
z8850
 
Cristian lizarazo
Cristian Lizarazo
 
Evaluation 4
imicki
 
Process mapping
kma0209
 
Ad

Similar to Angular workflow with gulp.js (20)

ODP
Introduction to GulpJs
Harish Gadiya
 
PDF
Workflow automation for Front-end web applications
Mayank Patel
 
PPTX
Automating WordPress Plugin Development with Gulp
Mike Hale
 
PDF
JLPDevs - Optimization Tooling for Modern Web App Development
JLP Community
 
PDF
Plumbin Pipelines - A Gulp.js workshop
Stefan Baumgartner
 
PDF
Grunt & Front-end Workflow
Pagepro
 
PDF
Getting started with gulpjs
unmesh dusane
 
PPTX
Getting Started with Gulp
Jure Šuvak
 
PPTX
Automating Your Workflow with Gulp.js - php[world] 2016
Colin O'Dell
 
ODP
Eclipse Buildship JUG Hamburg
simonscholz
 
PPTX
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Jesse Gallagher
 
PDF
Grunt.js introduction
Claudio Mignanti
 
ODP
Laziness with Gulp
chalist Nabizade
 
PDF
NodeJS
LinkMe Srl
 
PPTX
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
Fwdays
 
ODP
Gradle: The Build System you have been waiting for!
Corneil du Plessis
 
PDF
Getting Started With Grunt for WordPress Development
David Bisset
 
PDF
Web development tools { starter pack }
François Michaudon
 
PDF
Grails 101
David Jacobs
 
Introduction to GulpJs
Harish Gadiya
 
Workflow automation for Front-end web applications
Mayank Patel
 
Automating WordPress Plugin Development with Gulp
Mike Hale
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLP Community
 
Plumbin Pipelines - A Gulp.js workshop
Stefan Baumgartner
 
Grunt & Front-end Workflow
Pagepro
 
Getting started with gulpjs
unmesh dusane
 
Getting Started with Gulp
Jure Šuvak
 
Automating Your Workflow with Gulp.js - php[world] 2016
Colin O'Dell
 
Eclipse Buildship JUG Hamburg
simonscholz
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Jesse Gallagher
 
Grunt.js introduction
Claudio Mignanti
 
Laziness with Gulp
chalist Nabizade
 
NodeJS
LinkMe Srl
 
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
Fwdays
 
Gradle: The Build System you have been waiting for!
Corneil du Plessis
 
Getting Started With Grunt for WordPress Development
David Bisset
 
Web development tools { starter pack }
François Michaudon
 
Grails 101
David Jacobs
 
Ad

Recently uploaded (20)

PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 

Angular workflow with gulp.js