SlideShare a Scribd company logo
1 of 23
Download to read offline
JavaScript Build Automation
Scripts & Task Runners
• In General: Why, What, How?
• Automation with NPM Scripts
• Automation with Task Runners (Gulp)
JavaScript Build Automation
Build automation is the process of automating the
creation of a software build and the associated
processes including: compiling computer source code into
binary code, packaging binary code, and running
automated tests.
— Wikipedia
Why?
Not Waste Time for the Same
Process
Example: Preparing HTML/CSS/JS for
Production
• JS Compilation (TS || ES6 -> ES5)
• Minify
• Concat
• Styles Compilation (Sass || Less -> Css)
• Css Vendor Prefixes && Optimization
• Separately Handling Vendor and Custom Code
• Auto Injecting Files into HTML
• Running Tests
• Push to Production
• …
Example: Awesome Development
Environment
• Browser Live Reloading, File Watching
• JS Compilation
• Styles Compilation
• Linting
• Running Tests
• HTML Injection
Automate Tasks
Code Quality Tests Build Pipeline
What’s in It for You?
Improve Quality Deliver Faster
Repeatable
and Consistent
Automated Build Pipeline
Develop -> Analyze -> Test -> Build -> Deploy
Work Smarter, Not Harder
Automation with NPM Scripts
{
"name": "npm-scripts-tests",
"version": "1.0.0",
"scripts": {
"start": "node server.js",
"build": "tsc --out app.js"
},
"devDependencies": {
...
}
}
Automation with NPM Scripts
{
"name": "npm-scripts-tests",
"version": "1.0.1",
"scripts": {
"build:prod:libs": "bowcat libs.js && uglifyjs lib.js --compress --
mangle --output lib.js",
"build:prod:app": "tsc --out app.js && uglifyjs app.js --compress --
mangle --output app.js",
"build:prod:css": "node-sass src/styles/app.scss --recursive --output-
style compressed --output app.css",
"build:prod": "parallelshell "npm run build:prod:libs" "npm run
build:prod:app" "npm run build:prod:css"",
"build:dev:libs": "bowcat libs.js",
"build:dev:app": "tsc --out app.js",
"build:dev:css": "node-sass src/styles/app.scss --recursive --output-
style compressed --output app.css",
"build:dev": "parallelshell "npm run build:dev:libs" "npm run
build:dev:app" "npm run build:dev:css""
},
"devDependencies": {
...
}
}
Demo
Automation with NPM Scripts
• Build Steps as Shell Commands
• Don't Have the Complexity of a Full Build Tool.
• No Need to Install an Additional Command-line
Tool to Run Your Build.
Automation with Task Runners
http://gruntjs.comhttp://gulpjs.com
Gulp vs Grunt
• Code over Configuration
• More Compact Config
• VFS: No Temp Folders
• Streams Parallelism
Automation with Task Runners
• The Full Power of Node and JavaScript
• Consistent APIs Optimized for Composing Build
Tasks
• Huge Ecosystems of Plugins
• Avoid Cross-platform Compatibility Problems
Typical Gulp Task
File System -> Read Files -> Modify -> Modify ->
-> Modify -> Write Files -> Dest
Gulpfile.js
gulp.task('js', function() {

return gulp

.src('**/*.js')

.pipe($.eslint())

.pipe($.concat())

.pipe($.uglify())
.pipe(gulp.dest('./build/'))

})
Demo
Useful Links: NPM Scripts vs Task
Runners
	 •	 Build Tools vs npm Scripts: Why Not Both?

	 •	 Give Grunt the Boot! A Guide to Using npm as a Build Tool

	 •	 How to Use npm as a Build Tool

	 •	 Task Automation with npm Run

	 •	 Using npm as a Build System for Your next Project
Useful Resources to Learn
• 	 Whole Picture [read]

• 	 learn.javascript.ru Screen Cast Gulp [watch]

•	 Getting Started with Gulp [read][$]

•	 Gulp Basics [watch][$]

•	 JavaScript Build Automation With Gulp.js [watch][$]

•	 Learning Gulp - Getting Started with the Front End Factory [read]

•	 Rapid Gulp [watch][$]

•	 Using npm as a Task Runner [watch][$]

More Related Content

What's hot

Tc open-doors-day-speech
Tc open-doors-day-speechTc open-doors-day-speech
Tc open-doors-day-speechEvgeniy Koshkin
 
goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020
goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020
goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020AWSKRUG - AWS한국사용자모임
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sinkJoe Ferguson
 
Dev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teamsDev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teamsMahesh Arali
 
The future of cloud programming
The future of cloud programmingThe future of cloud programming
The future of cloud programmingJason Straughan
 
JSFoo-2017 Takeaways
JSFoo-2017 TakeawaysJSFoo-2017 Takeaways
JSFoo-2017 TakeawaysMir Ali
 
Coffee script final
Coffee script finalCoffee script final
Coffee script finalpriyankazope
 
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"Sigma Software
 
Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"Fwdays
 
Angular workflow with gulp.js
Angular workflow with gulp.jsAngular workflow with gulp.js
Angular workflow with gulp.jsCihad Horuzoğlu
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14Kevin Poorman
 
CLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.jsCLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.jsKarolis Labrencis
 
Scaling WordPress - WP on AWS
Scaling WordPress - WP on AWSScaling WordPress - WP on AWS
Scaling WordPress - WP on AWSstk_jj
 
Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Julien Biezemans
 
Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...Katherine Golovinova
 
Big Data DC - BenchPress
Big Data DC - BenchPressBig Data DC - BenchPress
Big Data DC - BenchPressDrew Stephens
 

What's hot (20)

Tc open-doors-day-speech
Tc open-doors-day-speechTc open-doors-day-speech
Tc open-doors-day-speech
 
goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020
goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020
goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020
 
JavaScript Task Runners - Gulp & Grunt
JavaScript Task Runners - Gulp & GruntJavaScript Task Runners - Gulp & Grunt
JavaScript Task Runners - Gulp & Grunt
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sink
 
Dev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teamsDev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teams
 
The future of cloud programming
The future of cloud programmingThe future of cloud programming
The future of cloud programming
 
JSFoo-2017 Takeaways
JSFoo-2017 TakeawaysJSFoo-2017 Takeaways
JSFoo-2017 Takeaways
 
Coffee script final
Coffee script finalCoffee script final
Coffee script final
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Build App with Nodejs - YWC Workshop
Build App with Nodejs - YWC WorkshopBuild App with Nodejs - YWC Workshop
Build App with Nodejs - YWC Workshop
 
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
 
Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"
 
Angular workflow with gulp.js
Angular workflow with gulp.jsAngular workflow with gulp.js
Angular workflow with gulp.js
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14
 
CLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.jsCLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.js
 
Scaling WordPress - WP on AWS
Scaling WordPress - WP on AWSScaling WordPress - WP on AWS
Scaling WordPress - WP on AWS
 
Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!
 
Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...
 
Azue Webjobs
Azue WebjobsAzue Webjobs
Azue Webjobs
 
Big Data DC - BenchPress
Big Data DC - BenchPressBig Data DC - BenchPress
Big Data DC - BenchPress
 

Viewers also liked

Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Adam Mokan
 
The rise of single-page applications
The rise of single-page applicationsThe rise of single-page applications
The rise of single-page applicationsCaridy Patino
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with GruntLadies Who Code
 
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...Tieturi Oy
 
An introduction in to the world of front end automation - frontend ne (02 07-15)
An introduction in to the world of front end automation - frontend ne (02 07-15)An introduction in to the world of front end automation - frontend ne (02 07-15)
An introduction in to the world of front end automation - frontend ne (02 07-15)frontendne
 
Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Boris Livshutz
 
The Dark Side of Single Page Applications
The Dark Side of Single Page ApplicationsThe Dark Side of Single Page Applications
The Dark Side of Single Page ApplicationsDor Kalev
 
Single page applications
Single page applicationsSingle page applications
Single page applicationsDiego Cardozo
 
Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2Oleksii Prohonnyi
 
Single page application
Single page applicationSingle page application
Single page applicationJeremy Lee
 
Measuring the Performance of Single Page Applications
Measuring the Performance of Single Page ApplicationsMeasuring the Performance of Single Page Applications
Measuring the Performance of Single Page ApplicationsNicholas Jansma
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applicationsSC5.io
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page ApplicationKMS Technology
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSM R Rony
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficientlypostmanclient
 

Viewers also liked (18)

Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012
 
The rise of single-page applications
The rise of single-page applicationsThe rise of single-page applications
The rise of single-page applications
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
 
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
 
An introduction in to the world of front end automation - frontend ne (02 07-15)
An introduction in to the world of front end automation - frontend ne (02 07-15)An introduction in to the world of front end automation - frontend ne (02 07-15)
An introduction in to the world of front end automation - frontend ne (02 07-15)
 
Single page applications
Single page applicationsSingle page applications
Single page applications
 
Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster
 
The Dark Side of Single Page Applications
The Dark Side of Single Page ApplicationsThe Dark Side of Single Page Applications
The Dark Side of Single Page Applications
 
Single page applications
Single page applicationsSingle page applications
Single page applications
 
Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2
 
Npm scripts
Npm scriptsNpm scripts
Npm scripts
 
Single page application
Single page applicationSingle page application
Single page application
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
Measuring the Performance of Single Page Applications
Measuring the Performance of Single Page ApplicationsMeasuring the Performance of Single Page Applications
Measuring the Performance of Single Page Applications
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applications
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently
 

Similar to JavaScript Build Automation: NPM Scripts vs Task Runners

Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Ryan Cuprak
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Emerson Eduardo Rodrigues Von Staffen
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...Amazon Web Services
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5David Voyles
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeansRyan Cuprak
 
Aws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon ElishaAws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon ElishaHelen Rogers
 
Grunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End TierGrunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End TierErick Brito
 
Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017Amazon Web Services
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldAmazon Web Services
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAmazon Web Services
 
DevOps on AWS - Accelerating Software Delivery
DevOps on AWS - Accelerating Software DeliveryDevOps on AWS - Accelerating Software Delivery
DevOps on AWS - Accelerating Software DeliveryAmazon Web Services
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAlberto Molina Coballes
 
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...Amazon Web Services
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterAmazon Web Services
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksAmazon Web Services
 
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...Amazon Web Services
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practicesCode Mastery
 

Similar to JavaScript Build Automation: NPM Scripts vs Task Runners (20)

Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
 
The MEAN Stack
The MEAN StackThe MEAN Stack
The MEAN Stack
 
Aws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon ElishaAws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon Elisha
 
Grunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End TierGrunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End Tier
 
Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck Talks
 
DevOps on AWS - Accelerating Software Delivery
DevOps on AWS - Accelerating Software DeliveryDevOps on AWS - Accelerating Software Delivery
DevOps on AWS - Accelerating Software Delivery
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
 
Devops
DevopsDevops
Devops
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver Faster
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech Talks
 
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

JavaScript Build Automation: NPM Scripts vs Task Runners

  • 2. • In General: Why, What, How? • Automation with NPM Scripts • Automation with Task Runners (Gulp) JavaScript Build Automation
  • 3. Build automation is the process of automating the creation of a software build and the associated processes including: compiling computer source code into binary code, packaging binary code, and running automated tests. — Wikipedia
  • 5. Not Waste Time for the Same Process
  • 6. Example: Preparing HTML/CSS/JS for Production • JS Compilation (TS || ES6 -> ES5) • Minify • Concat • Styles Compilation (Sass || Less -> Css) • Css Vendor Prefixes && Optimization • Separately Handling Vendor and Custom Code • Auto Injecting Files into HTML • Running Tests • Push to Production • …
  • 7. Example: Awesome Development Environment • Browser Live Reloading, File Watching • JS Compilation • Styles Compilation • Linting • Running Tests • HTML Injection
  • 8. Automate Tasks Code Quality Tests Build Pipeline
  • 9. What’s in It for You? Improve Quality Deliver Faster Repeatable and Consistent
  • 10. Automated Build Pipeline Develop -> Analyze -> Test -> Build -> Deploy
  • 12. Automation with NPM Scripts { "name": "npm-scripts-tests", "version": "1.0.0", "scripts": { "start": "node server.js", "build": "tsc --out app.js" }, "devDependencies": { ... } }
  • 13. Automation with NPM Scripts { "name": "npm-scripts-tests", "version": "1.0.1", "scripts": { "build:prod:libs": "bowcat libs.js && uglifyjs lib.js --compress -- mangle --output lib.js", "build:prod:app": "tsc --out app.js && uglifyjs app.js --compress -- mangle --output app.js", "build:prod:css": "node-sass src/styles/app.scss --recursive --output- style compressed --output app.css", "build:prod": "parallelshell "npm run build:prod:libs" "npm run build:prod:app" "npm run build:prod:css"", "build:dev:libs": "bowcat libs.js", "build:dev:app": "tsc --out app.js", "build:dev:css": "node-sass src/styles/app.scss --recursive --output- style compressed --output app.css", "build:dev": "parallelshell "npm run build:dev:libs" "npm run build:dev:app" "npm run build:dev:css"" }, "devDependencies": { ... } }
  • 14. Demo
  • 15. Automation with NPM Scripts • Build Steps as Shell Commands • Don't Have the Complexity of a Full Build Tool. • No Need to Install an Additional Command-line Tool to Run Your Build.
  • 16. Automation with Task Runners http://gruntjs.comhttp://gulpjs.com
  • 17. Gulp vs Grunt • Code over Configuration • More Compact Config • VFS: No Temp Folders • Streams Parallelism
  • 18. Automation with Task Runners • The Full Power of Node and JavaScript • Consistent APIs Optimized for Composing Build Tasks • Huge Ecosystems of Plugins • Avoid Cross-platform Compatibility Problems
  • 19. Typical Gulp Task File System -> Read Files -> Modify -> Modify -> -> Modify -> Write Files -> Dest
  • 20. Gulpfile.js gulp.task('js', function() {
 return gulp
 .src('**/*.js')
 .pipe($.eslint())
 .pipe($.concat())
 .pipe($.uglify()) .pipe(gulp.dest('./build/'))
 })
  • 21. Demo
  • 22. Useful Links: NPM Scripts vs Task Runners • Build Tools vs npm Scripts: Why Not Both? • Give Grunt the Boot! A Guide to Using npm as a Build Tool • How to Use npm as a Build Tool • Task Automation with npm Run • Using npm as a Build System for Your next Project
  • 23. Useful Resources to Learn • Whole Picture [read] • learn.javascript.ru Screen Cast Gulp [watch] • Getting Started with Gulp [read][$] • Gulp Basics [watch][$] • JavaScript Build Automation With Gulp.js [watch][$] • Learning Gulp - Getting Started with the Front End Factory [read] • Rapid Gulp [watch][$] • Using npm as a Task Runner [watch][$]