SlideShare a Scribd company logo
wherethetruck.at @JackBarker
GETTING STARTED WITH
#WPMelb
WHAT IS GRUNT ???
• “The JavaScript task runner”	

• gruntjs.com	

• Cross-platform	

• Runs on Node.js	

• nodejs.org
Grunt js and WordPress
SO… WHAT EXACTLY ARE
YOU AUTOMATING?
WHY AUTOMATE WITH
GRUNT?
Functionality
Ease of
use
Grunt js and WordPress
1. INSTALL GRUNT CLI
sudo npm install -g grunt-cli
Node Package Manager
Global
Grunt: Command Line Interface
Install
Super User: Do
If it doesn’t say
“Error”, then it
worked!
2. DECIDE WHERE TO
CREATE PROJECT
Project Root
Wordpress / public_html
wp_content
wp_config.php
[…etc]
package.json
3. CREATE NODE PROJECT
cd [your project root]
npm init
npm install grunt --save-dev
• Change directory;
• Node Package Manager;

Initialise a new project	

• Node Package Manager;

Install grunt to our project; and

Add it to our list of project dependencies
WHAT DIDTHAT DO?
4. GRUNT PLUGINS
• Javascript minification:

grunt-contrib-uglify	

• File concatenation:

grunt-contrib-concat	

• Unit Testing:

grunt-contrib-qunit
npm install grunt-contrib-uglify --save-dev
• JS hint:

grunt-contrib-jshint	

• Watch:

grunt-contrib-watch	

• GitHub
• Wordpress Deployment

grunt-wordpress-deploy

https://www.npmjs.org/package/grunt-wordpress-deploy
Grunt js and WordPress
5.WRITE OUR GRUNTFILE
Project Root
wordpress
wp_content
wp_config.php
[…etc]
Gruntfile.js
node_modules
package.json
WORKED EXAMPLE	

(UGLIFY)
Grunt js and WordPress
Example: https://github.com/gruntjs/grunt-contrib-uglify
Applied to Wordpress
RESULT
WORKED EXAMPLE	

(IMAGEMIN)
npm install grunt-contrib-imagemin --save-dev
Grunt js and WordPress
Grunt js and WordPress
MORE INFORMATION
• Grunt.js

http://gruntjs.com/getting-started	

• Chris Coyier:

http://24ways.org/2013/grunt-is-not-weird-and-hard/	

• Smashing Magazine:

http://www.smashingmagazine.com/2013/10/29/get-up-running-grunt/	

• Github

More Related Content

ODP
What grunt?
PDF
Grunt JS - Getting Started With Grunt
PPTX
Grunt - The JavaScript Task Runner
PPTX
Grunt understanding
PPTX
PDF
Preprocessor Workflow with Grunt
PDF
Front-end development automation with Grunt
PPTX
Grunt to automate JS build
What grunt?
Grunt JS - Getting Started With Grunt
Grunt - The JavaScript Task Runner
Grunt understanding
Preprocessor Workflow with Grunt
Front-end development automation with Grunt
Grunt to automate JS build

What's hot (20)

PDF
The swiss knife of a word press developer
PDF
Introduction to Express and Grunt
PDF
Time's Important - Let Task Management Save Yours
PDF
Production Ready Javascript With Grunt
PDF
Django Deployer
PDF
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
PPTX
The JAMStack (Javascript, APIs, Markup).
PDF
Building plugins like a pro
PDF
Modernizing Your WordPress Workflow with Grunt & Bower
PDF
Continuous integration with docker, buildbot and git
PDF
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
PDF
Vagrant up-and-running
PDF
Headless approach and Acquia - Case study - Chris Ozog
PDF
Developing Rails Apps in Technical Isolation
PDF
open source product management (feat. npm)
PDF
Saving Time and Money with Vagrant
PDF
Jenkins & OpenNebula a CD History - Alberto García
PPTX
Automating WordPress Plugin Development with Gulp
PDF
Go with the Flow - A Guide to a WordPress Workflow
The swiss knife of a word press developer
Introduction to Express and Grunt
Time's Important - Let Task Management Save Yours
Production Ready Javascript With Grunt
Django Deployer
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
The JAMStack (Javascript, APIs, Markup).
Building plugins like a pro
Modernizing Your WordPress Workflow with Grunt & Bower
Continuous integration with docker, buildbot and git
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
Vagrant up-and-running
Headless approach and Acquia - Case study - Chris Ozog
Developing Rails Apps in Technical Isolation
open source product management (feat. npm)
Saving Time and Money with Vagrant
Jenkins & OpenNebula a CD History - Alberto García
Automating WordPress Plugin Development with Gulp
Go with the Flow - A Guide to a WordPress Workflow
Ad

Viewers also liked (15)

PDF
Mastering Grunt
PPT
An Introduction to AngularJs Unittesting
ODP
Wrangling the WordPress Template Hierarchy Like a Boss
PDF
GruntJS + Wordpress
PDF
Angular js, Yeomon & Grunt
PPTX
Metadata and me
PPTX
WordPress Theme Development Workflow with Node.js, Ruby, Sass, Bower and Grunt
PDF
A Quick and Dirty D3.js Tutorial
PDF
Come migliorare le performance di WordPress con il Visual Composer
PDF
Javascript testing: tools of the trade
PDF
Using Composer to create manageable WordPress websites
PDF
WordPress Database: What's behind those 12 tables
PDF
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
PDF
WordPress Template Hierarchy
PDF
Getting Started With Grunt for WordPress Development
Mastering Grunt
An Introduction to AngularJs Unittesting
Wrangling the WordPress Template Hierarchy Like a Boss
GruntJS + Wordpress
Angular js, Yeomon & Grunt
Metadata and me
WordPress Theme Development Workflow with Node.js, Ruby, Sass, Bower and Grunt
A Quick and Dirty D3.js Tutorial
Come migliorare le performance di WordPress con il Visual Composer
Javascript testing: tools of the trade
Using Composer to create manageable WordPress websites
WordPress Database: What's behind those 12 tables
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
WordPress Template Hierarchy
Getting Started With Grunt for WordPress Development
Ad

Similar to Grunt js and WordPress (20)

PPTX
Modern Development Tools
PDF
Grunt.js and Yeoman, Continous Integration
PDF
Bootstrapping your plugin
PPTX
Introduction to using Grunt & Bower with WordPress theme development
PDF
Node & Express as Workflow Tools
PDF
Grunt training deck
PPTX
Improving Workflows With Grunt.js - Big D Design 2014 - Dallas Texas
PDF
Automate your WordPress Workflow with Grunt.js
PPTX
Grunt and Bower
PDF
Using GruntJS
PDF
Gulp - The Streaming Build System
PDF
Grunt All Day
PDF
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
PPTX
Dockerizing react app
PDF
Building your own personal minion with grunt.js
PDF
S&T What I know about Node 110817
PDF
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
PDF
NLUUG Spring 2012 - OpenShift Primer
PPTX
Deploy Your Website with GCP Workshop slides of GDG on Campus UNSTPB
ODP
DevAssistant, Docker and You
Modern Development Tools
Grunt.js and Yeoman, Continous Integration
Bootstrapping your plugin
Introduction to using Grunt & Bower with WordPress theme development
Node & Express as Workflow Tools
Grunt training deck
Improving Workflows With Grunt.js - Big D Design 2014 - Dallas Texas
Automate your WordPress Workflow with Grunt.js
Grunt and Bower
Using GruntJS
Gulp - The Streaming Build System
Grunt All Day
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-App...
Dockerizing react app
Building your own personal minion with grunt.js
S&T What I know about Node 110817
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
NLUUG Spring 2012 - OpenShift Primer
Deploy Your Website with GCP Workshop slides of GDG on Campus UNSTPB
DevAssistant, Docker and You

Recently uploaded (20)

PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
Tartificialntelligence_presentation.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
1. Introduction to Computer Programming.pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
August Patch Tuesday
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Assigned Numbers - 2025 - Bluetooth® Document
DP Operators-handbook-extract for the Mautical Institute
Tartificialntelligence_presentation.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Web App vs Mobile App What Should You Build First.pdf
WOOl fibre morphology and structure.pdf for textiles
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
1. Introduction to Computer Programming.pptx
Zenith AI: Advanced Artificial Intelligence
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
MIND Revenue Release Quarter 2 2025 Press Release
A comparative analysis of optical character recognition models for extracting...
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cloud_computing_Infrastucture_as_cloud_p
OMC Textile Division Presentation 2021.pptx
August Patch Tuesday
Digital-Transformation-Roadmap-for-Companies.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

Grunt js and WordPress