SlideShare a Scribd company logo
1 of 30
Download to read offline
GETTING STARTED WITH 
GRUNT FOR WORDPRESS 
DEVELOPMENT 
David “DANGER” Bisset 
WORDPRESS MEETUP - OCTOBER 2014
What Is A Task Runner? 
A task runner (or build system) is a 
script that executes a list of actions, 
typically using one or more plugins.
WHAT CAN YOU DO? 
PREPROCESSING 
• SASS 
• LESS 
• COFFEESCRIPT
WHAT CAN YOU DO? 
MINIFY 
• CSS 
• JAVASCRIPT
WHAT CAN YOU DO? 
MINIFY
WHAT CAN YOU DO? 
LINT FILES 
• JSHINT 
• JSLINT
WHAT CAN YOU DO? 
LIVE RELOAD CHANGES 
REFRESH BROWSER EACH TIME 
YOU MAKE A CHANGE TO A FILE
WHAT CAN YOU DO? 
Other THINGS: 
• START A WEB SERVER 
• OPTIMIZE IMAGES 
• OUTPUT TO HTML 
• ALMOST ANYTHING!
Popular Task Runners 
• GRUNT.JS 
• GULP.JS 
• CAKE 
• BRUNCH 
• BROCCOLI
LET’S TAKE 
A LOOK 
GRUNT.JS
Why Go With Grunt.JS? 
• Grunt.js is built on Node.js 
• It’s the most popular task runner 
• The community is large (and helpful) 
• Thousands of available plugins 
• Building custom plugins is really easy
GRUNT 
REQUIRES: 
NODE.JS
What Is Node.JS? 
NODE.JS IS JAVASCRIPT THAT RUNS ON A SERVER 
OR A TERMINAL
How Do You Install 
Node.JS? 
HTTP://NODEJS.ORG
NODE.JS 
COMES WITH: 
NPM (NODE PACKAGE MANAGER)
Installing Grunt CLI 
(Command Line Interface) 
npm install -g grunt-cli 
http://gruntjs.com/getting-started
PREPARING A 
NEW GRUNT PROJECT 
package.json
PREPARING A 
NEW GRUNT PROJECT 
Gruntfile.js
Installing 
grunt modules 
Uglify
Installing Uglify 
npm install grunt-contrib-uglify --save-dev 
https://github.com/gruntjs/grunt-contrib-uglify
Go Back To Gruntfile.js 
grunt
Go Back To Gruntfile.js 
grunt uglify
Installing 
grunt modules 
Watch
Installing Uglify 
npm install grunt-contrib-watch --save-dev 
https://www.npmjs.org/package/grunt-contrib-watch
Go Back To Gruntfile.js
How File Matching Works 
// Matches a single file 
files: 'foo.js' 
! 
// Matches an array of files 
files: [ 'foo.js', 'bar.js' ] 
! 
// Matches all files in the dir 
files: '*' 
! 
// Matches all files with a given extension in the dir 
files: '*.js' 
! 
// Matches all files with a given extension in all dirs 
files: '**/*.js' 
! 
// Matches all files w/extension in this dir and one dir deeper 
files: '{,*/}*.js'
Other Cool Links To Check Out 
https://www.npmjs.org/package/grunt-wordpress-deploy 
Deploy a Wordpress instance without pain using Grunt. 
you can define different environments. 
Adapt the Wordpress database to the destination domain.
Other Cool Links To Check Out 
https://github.com/10up/grunt-wp-plugin 
Create a WordPress plugin with grunt-init. 
https://github.com/10up/grunt-wp-theme 
Create a WordPress THEME with grunt-init.
Other Cool Links To Check Out 
https://github.com/roots/roots 
WordPress starter theme based on HTML5 Boilerplate & 
Bootstrap 
https://mondaybynoon.com/grunt-wordpress-theme-development/ 
MORE READING!
THANK YOU. 
David “SHOULD HAVE HAD A V8” Bisset 
davidbisset.com / @dimensionmedia

More Related Content

What's hot

VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment
Takayuki Miyauchi
 

What's hot (20)

Git basics
Git basicsGit basics
Git basics
 
Introduction to bower
Introduction to bowerIntroduction to bower
Introduction to bower
 
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
 
Using multi-tenant WordPress to simplify development
Using multi-tenant WordPress to simplify developmentUsing multi-tenant WordPress to simplify development
Using multi-tenant WordPress to simplify development
 
Testing all your code through HipChat in Docker
Testing all your code through HipChat in DockerTesting all your code through HipChat in Docker
Testing all your code through HipChat in Docker
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment
 
Git basics
Git basicsGit basics
Git basics
 
Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Infrastructure development on windows ldn cd meetup
Infrastructure development on windows   ldn cd meetup Infrastructure development on windows   ldn cd meetup
Infrastructure development on windows ldn cd meetup
 
Using a Private Git Server for Packaging Software
Using a Private Git Server for Packaging SoftwareUsing a Private Git Server for Packaging Software
Using a Private Git Server for Packaging Software
 
Node.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deploymentNode.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deployment
 
Modern Development Tools
Modern Development ToolsModern Development Tools
Modern Development Tools
 
Dockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber ExampleDockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber Example
 
node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!
 
Continuous delivery of Windows micro services in the cloud
Continuous delivery of Windows micro services in the cloud Continuous delivery of Windows micro services in the cloud
Continuous delivery of Windows micro services in the cloud
 
node.js app deploy to heroku PaaS
node.js app deploy to heroku PaaSnode.js app deploy to heroku PaaS
node.js app deploy to heroku PaaS
 
Bringing Javascript to the Desktop with Electron
Bringing Javascript to the Desktop with ElectronBringing Javascript to the Desktop with Electron
Bringing Javascript to the Desktop with Electron
 
Angular Part 3 (Basic knowledge)
Angular Part 3 (Basic knowledge)Angular Part 3 (Basic knowledge)
Angular Part 3 (Basic knowledge)
 
Teaching a Designer to Use GitHub
Teaching a Designer to Use GitHubTeaching a Designer to Use GitHub
Teaching a Designer to Use GitHub
 

Viewers also liked

An Introduction to AngularJs Unittesting
An Introduction to AngularJs UnittestingAn Introduction to AngularJs Unittesting
An Introduction to AngularJs Unittesting
Inthra onsap
 
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.js
ConFoo
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
Tom Croucher
 

Viewers also liked (20)

An Introduction to AngularJs Unittesting
An Introduction to AngularJs UnittestingAn Introduction to AngularJs Unittesting
An Introduction to AngularJs Unittesting
 
Angular js, Yeomon & Grunt
Angular js, Yeomon & GruntAngular js, Yeomon & Grunt
Angular js, Yeomon & Grunt
 
Mastering Grunt
Mastering GruntMastering Grunt
Mastering Grunt
 
Wrangling the WordPress Template Hierarchy Like a Boss
Wrangling the WordPress Template Hierarchy Like a BossWrangling the WordPress Template Hierarchy Like a Boss
Wrangling the WordPress Template Hierarchy Like a Boss
 
Grunt js and WordPress
Grunt js and WordPressGrunt js and WordPress
Grunt js and WordPress
 
GruntJS + Wordpress
GruntJS + WordpressGruntJS + Wordpress
GruntJS + Wordpress
 
WordPress Theme Development Workflow with Node.js, Ruby, Sass, Bower and Grunt
WordPress Theme Development Workflow with Node.js, Ruby, Sass, Bower and GruntWordPress Theme Development Workflow with Node.js, Ruby, Sass, Bower and Grunt
WordPress Theme Development Workflow with Node.js, Ruby, Sass, Bower and Grunt
 
Metadata and me
Metadata and meMetadata and me
Metadata and me
 
A Quick and Dirty D3.js Tutorial
A Quick and Dirty D3.js TutorialA Quick and Dirty D3.js Tutorial
A Quick and Dirty D3.js Tutorial
 
Grunt JS - Getting Started With Grunt
Grunt JS - Getting Started With GruntGrunt JS - Getting Started With Grunt
Grunt JS - Getting Started With Grunt
 
Angular 2.0: Getting ready
Angular 2.0: Getting readyAngular 2.0: Getting ready
Angular 2.0: Getting ready
 
Introduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal devIntroduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal dev
 
Come migliorare le performance di WordPress con il Visual Composer
Come migliorare le performance di WordPress con il Visual ComposerCome migliorare le performance di WordPress con il Visual Composer
Come migliorare le performance di WordPress con il Visual Composer
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developers
 
Javascript testing: tools of the trade
Javascript testing: tools of the tradeJavascript testing: tools of the trade
Javascript testing: tools of the trade
 
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.js
 
Using Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websitesUsing Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websites
 
Node.js ― Hello, world! の1歩先へ。
Node.js ― Hello, world! の1歩先へ。Node.js ― Hello, world! の1歩先へ。
Node.js ― Hello, world! の1歩先へ。
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tablesWordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
 

Similar to Getting Started With Grunt for WordPress Development

Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistrano
libsys
 

Similar to Getting Started With Grunt for WordPress Development (20)

Grunt
GruntGrunt
Grunt
 
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
 
Workflow automation for Front-end web applications
Workflow automation for Front-end web applicationsWorkflow automation for Front-end web applications
Workflow automation for Front-end web applications
 
WordPress automation and CI
WordPress automation and CIWordPress automation and CI
WordPress automation and CI
 
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...
 
Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistrano
 
Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)
 
Building your own personal minion with grunt.js
Building your own personal minion with grunt.jsBuilding your own personal minion with grunt.js
Building your own personal minion with grunt.js
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Grunt understanding
Grunt understandingGrunt understanding
Grunt understanding
 
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
 
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
 
Automate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.jsAutomate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.js
 
Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & docker
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 

More from David Bisset

WordCamp Tampa 2015
WordCamp Tampa 2015WordCamp Tampa 2015
WordCamp Tampa 2015
David Bisset
 
WPSessions - Thinking Outside The Box With BuddyPress
WPSessions - Thinking Outside The Box With BuddyPressWPSessions - Thinking Outside The Box With BuddyPress
WPSessions - Thinking Outside The Box With BuddyPress
David Bisset
 

More from David Bisset (20)

WordPress Theme Workshop: Part 0
WordPress Theme Workshop: Part 0WordPress Theme Workshop: Part 0
WordPress Theme Workshop: Part 0
 
WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1
 
WordPress Theme Workshop: Part 2
WordPress Theme Workshop: Part 2WordPress Theme Workshop: Part 2
WordPress Theme Workshop: Part 2
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4
 
WordPress Theme Workshop: Customizer
WordPress Theme Workshop: CustomizerWordPress Theme Workshop: Customizer
WordPress Theme Workshop: Customizer
 
WordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: CSS/JSWordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: CSS/JS
 
WordPress Theme Workshop: Internationalization
WordPress Theme Workshop: InternationalizationWordPress Theme Workshop: Internationalization
WordPress Theme Workshop: Internationalization
 
WordPress Theme Workshop: Misc
WordPress Theme Workshop: MiscWordPress Theme Workshop: Misc
WordPress Theme Workshop: Misc
 
WordPress Theme Workshop: Widgets
WordPress Theme Workshop: WidgetsWordPress Theme Workshop: Widgets
WordPress Theme Workshop: Widgets
 
WordPress Theme Workshop: Menus
WordPress Theme Workshop: MenusWordPress Theme Workshop: Menus
WordPress Theme Workshop: Menus
 
WordPress Theme Workshop: Sidebars
WordPress Theme Workshop: SidebarsWordPress Theme Workshop: Sidebars
WordPress Theme Workshop: Sidebars
 
WordPress Theme Workshop: Theme Setup
WordPress Theme Workshop: Theme SetupWordPress Theme Workshop: Theme Setup
WordPress Theme Workshop: Theme Setup
 
BuddyPress & Higher Education
BuddyPress & Higher EducationBuddyPress & Higher Education
BuddyPress & Higher Education
 
WordPress Meetup (Davie, FL) - Top 9 April 2016
WordPress Meetup (Davie, FL) - Top 9 April 2016WordPress Meetup (Davie, FL) - Top 9 April 2016
WordPress Meetup (Davie, FL) - Top 9 April 2016
 
WordCamp Tampa 2015
WordCamp Tampa 2015WordCamp Tampa 2015
WordCamp Tampa 2015
 
BuddyPress v4
BuddyPress v4BuddyPress v4
BuddyPress v4
 
WPSessions - Thinking Outside The Box With BuddyPress
WPSessions - Thinking Outside The Box With BuddyPressWPSessions - Thinking Outside The Box With BuddyPress
WPSessions - Thinking Outside The Box With BuddyPress
 
SunShine PHP
SunShine PHPSunShine PHP
SunShine PHP
 
Building Next Generation Applications With BuddyPress
Building Next Generation Applications With BuddyPressBuilding Next Generation Applications With BuddyPress
Building Next Generation Applications With BuddyPress
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Getting Started With Grunt for WordPress Development

  • 1. GETTING STARTED WITH GRUNT FOR WORDPRESS DEVELOPMENT David “DANGER” Bisset WORDPRESS MEETUP - OCTOBER 2014
  • 2. What Is A Task Runner? A task runner (or build system) is a script that executes a list of actions, typically using one or more plugins.
  • 3. WHAT CAN YOU DO? PREPROCESSING • SASS • LESS • COFFEESCRIPT
  • 4. WHAT CAN YOU DO? MINIFY • CSS • JAVASCRIPT
  • 5. WHAT CAN YOU DO? MINIFY
  • 6. WHAT CAN YOU DO? LINT FILES • JSHINT • JSLINT
  • 7. WHAT CAN YOU DO? LIVE RELOAD CHANGES REFRESH BROWSER EACH TIME YOU MAKE A CHANGE TO A FILE
  • 8. WHAT CAN YOU DO? Other THINGS: • START A WEB SERVER • OPTIMIZE IMAGES • OUTPUT TO HTML • ALMOST ANYTHING!
  • 9. Popular Task Runners • GRUNT.JS • GULP.JS • CAKE • BRUNCH • BROCCOLI
  • 10. LET’S TAKE A LOOK GRUNT.JS
  • 11. Why Go With Grunt.JS? • Grunt.js is built on Node.js • It’s the most popular task runner • The community is large (and helpful) • Thousands of available plugins • Building custom plugins is really easy
  • 13. What Is Node.JS? NODE.JS IS JAVASCRIPT THAT RUNS ON A SERVER OR A TERMINAL
  • 14. How Do You Install Node.JS? HTTP://NODEJS.ORG
  • 15. NODE.JS COMES WITH: NPM (NODE PACKAGE MANAGER)
  • 16. Installing Grunt CLI (Command Line Interface) npm install -g grunt-cli http://gruntjs.com/getting-started
  • 17. PREPARING A NEW GRUNT PROJECT package.json
  • 18. PREPARING A NEW GRUNT PROJECT Gruntfile.js
  • 20. Installing Uglify npm install grunt-contrib-uglify --save-dev https://github.com/gruntjs/grunt-contrib-uglify
  • 21. Go Back To Gruntfile.js grunt
  • 22. Go Back To Gruntfile.js grunt uglify
  • 24. Installing Uglify npm install grunt-contrib-watch --save-dev https://www.npmjs.org/package/grunt-contrib-watch
  • 25. Go Back To Gruntfile.js
  • 26. How File Matching Works // Matches a single file files: 'foo.js' ! // Matches an array of files files: [ 'foo.js', 'bar.js' ] ! // Matches all files in the dir files: '*' ! // Matches all files with a given extension in the dir files: '*.js' ! // Matches all files with a given extension in all dirs files: '**/*.js' ! // Matches all files w/extension in this dir and one dir deeper files: '{,*/}*.js'
  • 27. Other Cool Links To Check Out https://www.npmjs.org/package/grunt-wordpress-deploy Deploy a Wordpress instance without pain using Grunt. you can define different environments. Adapt the Wordpress database to the destination domain.
  • 28. Other Cool Links To Check Out https://github.com/10up/grunt-wp-plugin Create a WordPress plugin with grunt-init. https://github.com/10up/grunt-wp-theme Create a WordPress THEME with grunt-init.
  • 29. Other Cool Links To Check Out https://github.com/roots/roots WordPress starter theme based on HTML5 Boilerplate & Bootstrap https://mondaybynoon.com/grunt-wordpress-theme-development/ MORE READING!
  • 30. THANK YOU. David “SHOULD HAVE HAD A V8” Bisset davidbisset.com / @dimensionmedia