SlideShare a Scribd company logo
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

PDF
Preprocessor Workflow with Grunt
PDF
Production Ready Javascript With Grunt
PDF
Front-end development automation with Grunt
PPTX
Grunt to automate JS build
PDF
Introduction to Express and Grunt
PPTX
Grunt - The JavaScript Task Runner
PDF
Kubeflow Development Environment
PPTX
Windows Azure Web Sites - Things they don’t teach kids in school - BuildStuffLT
Preprocessor Workflow with Grunt
Production Ready Javascript With Grunt
Front-end development automation with Grunt
Grunt to automate JS build
Introduction to Express and Grunt
Grunt - The JavaScript Task Runner
Kubeflow Development Environment
Windows Azure Web Sites - Things they don’t teach kids in school - BuildStuffLT

What's hot (20)

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

Viewers also liked (20)

PPT
An Introduction to AngularJs Unittesting
PDF
Angular js, Yeomon & Grunt
PDF
Mastering Grunt
ODP
Wrangling the WordPress Template Hierarchy Like a Boss
PDF
Grunt js and WordPress
PDF
GruntJS + Wordpress
PPTX
WordPress Theme Development Workflow with Node.js, Ruby, Sass, Bower and Grunt
PPTX
Metadata and me
PDF
A Quick and Dirty D3.js Tutorial
PDF
Grunt JS - Getting Started With Grunt
PPTX
Angular 2.0: Getting ready
PDF
Introduction to Node.js: perspectives from a Drupal dev
PDF
Come migliorare le performance di WordPress con il Visual Composer
PPTX
Node.js Patterns for Discerning Developers
PDF
Javascript testing: tools of the trade
PDF
Building servers with Node.js
PDF
Using Composer to create manageable WordPress websites
KEY
Node.js ― Hello, world! の1歩先へ。
KEY
Writing robust Node.js applications
PDF
WordPress Database: What's behind those 12 tables
An Introduction to AngularJs Unittesting
Angular js, Yeomon & Grunt
Mastering Grunt
Wrangling the WordPress Template Hierarchy Like a Boss
Grunt js and WordPress
GruntJS + Wordpress
WordPress Theme Development Workflow with Node.js, Ruby, Sass, Bower and Grunt
Metadata and me
A Quick and Dirty D3.js Tutorial
Grunt JS - Getting Started With Grunt
Angular 2.0: Getting ready
Introduction to Node.js: perspectives from a Drupal dev
Come migliorare le performance di WordPress con il Visual Composer
Node.js Patterns for Discerning Developers
Javascript testing: tools of the trade
Building servers with Node.js
Using Composer to create manageable WordPress websites
Node.js ― Hello, world! の1歩先へ。
Writing robust Node.js applications
WordPress Database: What's behind those 12 tables
Ad

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

PDF
GruntJS
PDF
Grunt training deck
PDF
Grunt: the wild boar dev's best friend - WordCamp London 2018
PDF
Front End Development Automation with Grunt
PDF
Quest for the Perfect Workflow for McrFRED
PDF
Javascript is your (Auto)mate
PPTX
Grunt understanding
PDF
Grunt.js and Yeoman, Continous Integration
PDF
Grunt All Day
PDF
Grunt & Front-end Workflow
PPTX
Front end development gurant
PPT
Npmgruntgulp
PDF
Intro to grunt
PDF
Automate your WordPress Workflow with Grunt.js
PDF
Get Gulping with Javascript Task Runners
PDF
Get Grulping with Javascript task runners
PDF
Get Grulping with JavaScript Task Runners (Matt Gifford)
PDF
Let Grunt do the work, focus on the fun!
PPTX
Introduction to using Grunt & Bower with WordPress theme development
GruntJS
Grunt training deck
Grunt: the wild boar dev's best friend - WordCamp London 2018
Front End Development Automation with Grunt
Quest for the Perfect Workflow for McrFRED
Javascript is your (Auto)mate
Grunt understanding
Grunt.js and Yeoman, Continous Integration
Grunt All Day
Grunt & Front-end Workflow
Front end development gurant
Npmgruntgulp
Intro to grunt
Automate your WordPress Workflow with Grunt.js
Get Gulping with Javascript Task Runners
Get Grulping with Javascript task runners
Get Grulping with JavaScript Task Runners (Matt Gifford)
Let Grunt do the work, focus on the fun!
Introduction to using Grunt & Bower with WordPress theme development

More from David Bisset (20)

PDF
WordPress Theme Workshop: Part 0
PDF
WordPress Theme Workshop: Part 1
PDF
WordPress Theme Workshop: Part 2
PDF
WordPress Theme Workshop: Part 3
PDF
WordPress Theme Workshop: Part 4
PDF
WordPress Theme Workshop: Customizer
PDF
WordPress Theme Workshop: CSS/JS
PDF
WordPress Theme Workshop: Internationalization
PDF
WordPress Theme Workshop: Misc
PDF
WordPress Theme Workshop: Widgets
PDF
WordPress Theme Workshop: Menus
PDF
WordPress Theme Workshop: Sidebars
PDF
WordPress Theme Workshop: Theme Setup
PPTX
BuddyPress & Higher Education
PDF
WordPress Meetup (Davie, FL) - Top 9 April 2016
PDF
WordCamp Tampa 2015
PDF
BuddyPress v4
PDF
WPSessions - Thinking Outside The Box With BuddyPress
PDF
SunShine PHP
PDF
Building Next Generation Applications With BuddyPress
WordPress Theme Workshop: Part 0
WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 2
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Customizer
WordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: Internationalization
WordPress Theme Workshop: Misc
WordPress Theme Workshop: Widgets
WordPress Theme Workshop: Menus
WordPress Theme Workshop: Sidebars
WordPress Theme Workshop: Theme Setup
BuddyPress & Higher Education
WordPress Meetup (Davie, FL) - Top 9 April 2016
WordCamp Tampa 2015
BuddyPress v4
WPSessions - Thinking Outside The Box With BuddyPress
SunShine PHP
Building Next Generation Applications With BuddyPress

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
KodekX | Application Modernization Development
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Electronic commerce courselecture one. Pdf
PPTX
Cloud computing and distributed systems.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KodekX | Application Modernization Development
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Electronic commerce courselecture one. Pdf
Cloud computing and distributed systems.
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Monthly Chronicles - July 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectral efficient network and resource selection model in 5G networks
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
The AUB Centre for AI in Media Proposal.docx
Chapter 3 Spatial Domain Image Processing.pdf
Modernizing your data center with Dell and AMD
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Digital-Transformation-Roadmap-for-Companies.pptx

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