SlideShare a Scribd company logo
1 of 19
SỬ DỤNG GULP TRONG
PHÁT TRIỂN THEME
NGUYỄN VĂN ĐƯỢC – LAPTRINH.SENVIET.ORG
CONTENT
• Why we should change.
• How to use Gulp.
• What plugins should be used.
DEVELOPMENT BUILD
CODE
COMPILE
CODE
COMPRESS
IMAGES
CLEAN FILES
UPDATE
CHANGELOG
VERSION
DOCCUMENT
ZIP
CODE
COMPILE CODE
BROWSER ON PC
BROWSER ON MOBILE
BUILD CODE
COMPILE CODE
COMPRESS IMAGES
REMOVE FILES
UPDATE CHANGELOG
BUMB VERSION
UPDATE
DOCCUMENT
ZIP
WE HATE
• Do things repeatedly.
• Many tedious task.
• Waste of time.
• Complex config.
WE LOVE
• SASS, ES6.
• Optimize image.
• More time to do exciting task.
• Do less, get more.
TASK RUNNER
TASK RUNNER
Config: easier to read
Speed: Fast
Plugin: 2670 plugins
Personal Interest
GO WITH
GULP BUILD
DEVELOPMENT
config tasks
gulp dev
code
gulp build
INSTALL GULP
Install nodejs Install gulp cli
Install gulpConfig task
$ npm install –g gulp-cli
$ mkdir my-project
$ cd my-project
$ npm install gulp --save-dev
$ >> gulpfile.js
PROJECT STRUCTURE
gulptheme
|-- dev
| |-- fonts
| |-- scss
| | `-- main.scss
| |-- js
| | |-- mergable
| | | |-- share-dialog.js
| | | `-- script.js
| | `-- customizer.js
| `-- img
THE PLUGIN NEEDED
• gulp-sass
• gulp-concat
• gulp-autoprefixer
• gulp-uglify
• gulp-plumber
• browser-sync
• gulp-imagemin
• gulp-zip
PLUGIN
$ npm install gulp-sass gulp-autoprefixer –save-dev
--------------------------------------------------
1 const sass = require('gulp-sass');
2 const autoprefixer = require('gulp-autoprefixer');
3
4 gulp.task('sass', function() {
5 return gulp.src(scssFiles)
6 .pipe(plumber({ errorHandler: onError }))
7 .pipe(sass())
8 .pipe(autoprefixer())
9 .pipe(gulp.dest("css"))
10 .pipe(browserSync.stream());
11 });
SASS
PLUGIN
$ npm install gulp-imagemin –save-dev
--------------------------------------------------
1 const imagemin = require('gulp-imagemin');
2 const plumber = require('gulp-plumber');
3
4 gulp.task(’image', function() {
5 return gulp.src(imageFiles)
6 .pipe(plumber({ errorHandler: onError }))
7 .pipe(imagemin())
8 .pipe(gulp.dest('img'));
9 });
IMAGE
PLUGIN
$ npm install gulp-concat –save-dev
--------------------------------------------------
1 const concat = require('gulp-concat');
2 const plumber = require('gulp-plumber');
3
4 gulp.task(‘js-vendor ', function() {
5 return gulp.src(jsFiles)
6 .pipe(plumber({ errorHandler: onError }))
7 .pipe(concat(‘vendor.js’))
8 .pipe(uglify())
9 .pipe(gulp.dest(’js'));
10 });
JACASCRIPT
PLUGIN
JACASCRIPT
HỎI ĐÁP
NguyenVanDuocIT@gmail.com
CẢM ƠN CÁC BẠN
LAPTRINH.SENVIET.ORG

More Related Content

What's hot

Gulp: Your Build Process Will Thank You
Gulp: Your Build Process Will Thank YouGulp: Your Build Process Will Thank You
Gulp: Your Build Process Will Thank YouRadWorks
 
New Horizons for Workbench: Viewing and Editing in the Browser
New Horizons for Workbench: Viewing and Editing in the BrowserNew Horizons for Workbench: Viewing and Editing in the Browser
New Horizons for Workbench: Viewing and Editing in the BrowserSafe Software
 
Gulp - the streaming build system
Gulp - the streaming build systemGulp - the streaming build system
Gulp - the streaming build systemSergey Romaneko
 
What I Learned from Optimizing Workspaces through Many Years
What I Learned from Optimizing Workspaces through Many YearsWhat I Learned from Optimizing Workspaces through Many Years
What I Learned from Optimizing Workspaces through Many YearsSafe Software
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with ChefJonathan Weiss
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansiblewajrcs
 
Introduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentIntroduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentJames Bundey
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the MassesSai Perchard
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and YouBryan Berry
 
Modernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & BowerModernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & BowerAlan Crissey
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Derek Jacoby
 
Introduction to Gulp
Introduction to GulpIntroduction to Gulp
Introduction to Gulpapdhtg6
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Derek Jacoby
 
Getting started with Chef
Getting started with ChefGetting started with Chef
Getting started with ChefEdureka!
 
Jco12 eclipse 구글앱엔진으로 JSP 시작하기
Jco12 eclipse 구글앱엔진으로 JSP 시작하기Jco12 eclipse 구글앱엔진으로 JSP 시작하기
Jco12 eclipse 구글앱엔진으로 JSP 시작하기Kenu, GwangNam Heo
 
A holistic approach to web performance
A holistic approach to web performanceA holistic approach to web performance
A holistic approach to web performanceAustin Gil
 
Configuration As Code: The Job DSL Plugin
Configuration As Code: The Job DSL PluginConfiguration As Code: The Job DSL Plugin
Configuration As Code: The Job DSL PluginDaniel Spilker
 

What's hot (19)

Gulp: Your Build Process Will Thank You
Gulp: Your Build Process Will Thank YouGulp: Your Build Process Will Thank You
Gulp: Your Build Process Will Thank You
 
New Horizons for Workbench: Viewing and Editing in the Browser
New Horizons for Workbench: Viewing and Editing in the BrowserNew Horizons for Workbench: Viewing and Editing in the Browser
New Horizons for Workbench: Viewing and Editing in the Browser
 
Gulp - the streaming build system
Gulp - the streaming build systemGulp - the streaming build system
Gulp - the streaming build system
 
What I Learned from Optimizing Workspaces through Many Years
What I Learned from Optimizing Workspaces through Many YearsWhat I Learned from Optimizing Workspaces through Many Years
What I Learned from Optimizing Workspaces through Many Years
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
 
Introduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentIntroduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme development
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the Masses
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and You
 
Modernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & BowerModernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & Bower
 
Jenkins Job DSL plugin
Jenkins Job DSL plugin Jenkins Job DSL plugin
Jenkins Job DSL plugin
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Job DSL Plugin for Jenkins
Job DSL Plugin for JenkinsJob DSL Plugin for Jenkins
Job DSL Plugin for Jenkins
 
Introduction to Gulp
Introduction to GulpIntroduction to Gulp
Introduction to Gulp
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
 
Getting started with Chef
Getting started with ChefGetting started with Chef
Getting started with Chef
 
Jco12 eclipse 구글앱엔진으로 JSP 시작하기
Jco12 eclipse 구글앱엔진으로 JSP 시작하기Jco12 eclipse 구글앱엔진으로 JSP 시작하기
Jco12 eclipse 구글앱엔진으로 JSP 시작하기
 
A holistic approach to web performance
A holistic approach to web performanceA holistic approach to web performance
A holistic approach to web performance
 
Configuration As Code: The Job DSL Plugin
Configuration As Code: The Job DSL PluginConfiguration As Code: The Job DSL Plugin
Configuration As Code: The Job DSL Plugin
 

Viewers also liked

樹梅派Wi–fi應用(期中報告)
樹梅派Wi–fi應用(期中報告)樹梅派Wi–fi應用(期中報告)
樹梅派Wi–fi應用(期中報告)青雨 李
 
The Customer Experience Revolution Coming to Everywhere Near You!
The Customer Experience Revolution Coming to Everywhere Near You!The Customer Experience Revolution Coming to Everywhere Near You!
The Customer Experience Revolution Coming to Everywhere Near You!Jennie Vickers
 
Uksc&ca20142
Uksc&ca20142Uksc&ca20142
Uksc&ca20142Miss Hart
 
Getting Started with Amazon Aurora
 Getting Started with Amazon Aurora Getting Started with Amazon Aurora
Getting Started with Amazon AuroraAmazon Web Services
 
Dysmyelination syndromes
Dysmyelination syndromesDysmyelination syndromes
Dysmyelination syndromesAmr Hassan
 
Pediatric multiple sclerosis
Pediatric multiple sclerosisPediatric multiple sclerosis
Pediatric multiple sclerosisAmr Hassan
 

Viewers also liked (11)

美麗的繭
美麗的繭美麗的繭
美麗的繭
 
Ban tin logistics thang 05 2016
Ban tin logistics thang 05 2016Ban tin logistics thang 05 2016
Ban tin logistics thang 05 2016
 
Smith, Doug H. - handout
Smith, Doug H. - handoutSmith, Doug H. - handout
Smith, Doug H. - handout
 
樹梅派Wi–fi應用(期中報告)
樹梅派Wi–fi應用(期中報告)樹梅派Wi–fi應用(期中報告)
樹梅派Wi–fi應用(期中報告)
 
The Customer Experience Revolution Coming to Everywhere Near You!
The Customer Experience Revolution Coming to Everywhere Near You!The Customer Experience Revolution Coming to Everywhere Near You!
The Customer Experience Revolution Coming to Everywhere Near You!
 
Uksc&ca20142
Uksc&ca20142Uksc&ca20142
Uksc&ca20142
 
Getting Started with Amazon Aurora
 Getting Started with Amazon Aurora Getting Started with Amazon Aurora
Getting Started with Amazon Aurora
 
Abdallah Badr 2015
Abdallah Badr 2015Abdallah Badr 2015
Abdallah Badr 2015
 
Intox2014
Intox2014Intox2014
Intox2014
 
Dysmyelination syndromes
Dysmyelination syndromesDysmyelination syndromes
Dysmyelination syndromes
 
Pediatric multiple sclerosis
Pediatric multiple sclerosisPediatric multiple sclerosis
Pediatric multiple sclerosis
 

Similar to Sử dụng Gulp trong phát triển theme

The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IOded Sagir
 
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsGDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsDominik Prokop
 
Ember addons, served three ways
Ember addons, served three waysEmber addons, served three ways
Ember addons, served three waysMike North
 
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...Evan Mullins
 
Everything in code_slides
Everything in code_slidesEverything in code_slides
Everything in code_slidesMack Hardy
 
Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Stéphane Bégaudeau
 
Production Ready WordPress - WC Utrecht 2017
Production Ready WordPress  - WC Utrecht 2017Production Ready WordPress  - WC Utrecht 2017
Production Ready WordPress - WC Utrecht 2017Edmund Turbin
 
Production Ready WordPress #WPLDN
Production Ready WordPress #WPLDNProduction Ready WordPress #WPLDN
Production Ready WordPress #WPLDNEdmund Turbin
 
GoPro, Inc. Case study: Dive into the details of our web applications
GoPro, Inc. Case study: Dive into the details of our web applicationsGoPro, Inc. Case study: Dive into the details of our web applications
GoPro, Inc. Case study: Dive into the details of our web applicationsAndrew Maxwell
 
Quest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDQuest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDAndi Smith
 
Make JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and CleanMake JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and CleanBlue Raster
 
Angular boilerplate generator
Angular boilerplate generatorAngular boilerplate generator
Angular boilerplate generatorVincent De Smet
 
Go Pro, Inc. Case Study: Dive into the details of our node.js applications
Go Pro, Inc. Case Study: Dive into the details of our node.js applicationsGo Pro, Inc. Case Study: Dive into the details of our node.js applications
Go Pro, Inc. Case Study: Dive into the details of our node.js applicationsAndrew Maxwell
 
Building a PaaS using Chef
Building a PaaS using ChefBuilding a PaaS using Chef
Building a PaaS using ChefShaun Domingo
 
Getting Started With Grunt for WordPress Development
Getting Started With Grunt for WordPress DevelopmentGetting Started With Grunt for WordPress Development
Getting Started With Grunt for WordPress DevelopmentDavid Bisset
 
Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Milindu Sanoj Kumarage
 

Similar to Sử dụng Gulp trong phát triển theme (20)

The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
 
Front-End Tooling
Front-End ToolingFront-End Tooling
Front-End Tooling
 
Sppp presentation
Sppp presentationSppp presentation
Sppp presentation
 
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsGDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
 
Ember addons, served three ways
Ember addons, served three waysEmber addons, served three ways
Ember addons, served three ways
 
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
 
Everything in code_slides
Everything in code_slidesEverything in code_slides
Everything in code_slides
 
Building JavaScript
Building JavaScriptBuilding JavaScript
Building JavaScript
 
Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014
 
Production Ready WordPress - WC Utrecht 2017
Production Ready WordPress  - WC Utrecht 2017Production Ready WordPress  - WC Utrecht 2017
Production Ready WordPress - WC Utrecht 2017
 
Production Ready WordPress #WPLDN
Production Ready WordPress #WPLDNProduction Ready WordPress #WPLDN
Production Ready WordPress #WPLDN
 
GoPro, Inc. Case study: Dive into the details of our web applications
GoPro, Inc. Case study: Dive into the details of our web applicationsGoPro, Inc. Case study: Dive into the details of our web applications
GoPro, Inc. Case study: Dive into the details of our web applications
 
Quest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDQuest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFRED
 
Make JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and CleanMake JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and Clean
 
Angular boilerplate generator
Angular boilerplate generatorAngular boilerplate generator
Angular boilerplate generator
 
Go Pro, Inc. Case Study: Dive into the details of our node.js applications
Go Pro, Inc. Case Study: Dive into the details of our node.js applicationsGo Pro, Inc. Case Study: Dive into the details of our node.js applications
Go Pro, Inc. Case Study: Dive into the details of our node.js applications
 
Building a PaaS using Chef
Building a PaaS using ChefBuilding a PaaS using Chef
Building a PaaS using Chef
 
Getting Started With Grunt for WordPress Development
Getting Started With Grunt for WordPress DevelopmentGetting Started With Grunt for WordPress Development
Getting Started With Grunt for WordPress Development
 
Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!
 
Gulp: Task Runner
Gulp: Task RunnerGulp: Task Runner
Gulp: Task Runner
 

Recently uploaded

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 

Recently uploaded (20)

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
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...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 

Sử dụng Gulp trong phát triển theme

  • 1. SỬ DỤNG GULP TRONG PHÁT TRIỂN THEME NGUYỄN VĂN ĐƯỢC – LAPTRINH.SENVIET.ORG
  • 2. CONTENT • Why we should change. • How to use Gulp. • What plugins should be used.
  • 4. BUILD CODE COMPILE CODE COMPRESS IMAGES REMOVE FILES UPDATE CHANGELOG BUMB VERSION UPDATE DOCCUMENT ZIP
  • 5. WE HATE • Do things repeatedly. • Many tedious task. • Waste of time. • Complex config.
  • 6. WE LOVE • SASS, ES6. • Optimize image. • More time to do exciting task. • Do less, get more.
  • 9. Config: easier to read Speed: Fast Plugin: 2670 plugins Personal Interest
  • 10. GO WITH GULP BUILD DEVELOPMENT config tasks gulp dev code gulp build
  • 11. INSTALL GULP Install nodejs Install gulp cli Install gulpConfig task $ npm install –g gulp-cli $ mkdir my-project $ cd my-project $ npm install gulp --save-dev $ >> gulpfile.js
  • 12. PROJECT STRUCTURE gulptheme |-- dev | |-- fonts | |-- scss | | `-- main.scss | |-- js | | |-- mergable | | | |-- share-dialog.js | | | `-- script.js | | `-- customizer.js | `-- img
  • 13. THE PLUGIN NEEDED • gulp-sass • gulp-concat • gulp-autoprefixer • gulp-uglify • gulp-plumber • browser-sync • gulp-imagemin • gulp-zip
  • 14. PLUGIN $ npm install gulp-sass gulp-autoprefixer –save-dev -------------------------------------------------- 1 const sass = require('gulp-sass'); 2 const autoprefixer = require('gulp-autoprefixer'); 3 4 gulp.task('sass', function() { 5 return gulp.src(scssFiles) 6 .pipe(plumber({ errorHandler: onError })) 7 .pipe(sass()) 8 .pipe(autoprefixer()) 9 .pipe(gulp.dest("css")) 10 .pipe(browserSync.stream()); 11 }); SASS
  • 15. PLUGIN $ npm install gulp-imagemin –save-dev -------------------------------------------------- 1 const imagemin = require('gulp-imagemin'); 2 const plumber = require('gulp-plumber'); 3 4 gulp.task(’image', function() { 5 return gulp.src(imageFiles) 6 .pipe(plumber({ errorHandler: onError })) 7 .pipe(imagemin()) 8 .pipe(gulp.dest('img')); 9 }); IMAGE
  • 16. PLUGIN $ npm install gulp-concat –save-dev -------------------------------------------------- 1 const concat = require('gulp-concat'); 2 const plumber = require('gulp-plumber'); 3 4 gulp.task(‘js-vendor ', function() { 5 return gulp.src(jsFiles) 6 .pipe(plumber({ errorHandler: onError })) 7 .pipe(concat(‘vendor.js’)) 8 .pipe(uglify()) 9 .pipe(gulp.dest(’js')); 10 }); JACASCRIPT
  • 19. CẢM ƠN CÁC BẠN LAPTRINH.SENVIET.ORG

Editor's Notes

  1. Ví dụ ta tạo một loạt thao tác, compile scss, điền minify, combine nhiều file, đổi tên file. Rồi khi có file scss nào đó thay đổi thì một loạt thao tác trên được thực hiện tự động.
  2. Ví dụ ta tạo một loạt thao tác, compile scss, điền minify, combine nhiều file, đổi tên file. Rồi khi có file scss nào đó thay đổi thì một loạt thao tác trên được thực hiện tự động.
  3. Ví dụ ta tạo một loạt thao tác, compile scss, điền minify, combine nhiều file, đổi tên file. Rồi khi có file scss nào đó thay đổi thì một loạt thao tác trên được thực hiện tự động.
  4. Ví dụ ta tạo một loạt thao tác, compile scss, điền minify, combine nhiều file, đổi tên file. Rồi khi có file scss nào đó thay đổi thì một loạt thao tác trên được thực hiện tự động.