iMasters InterCon Dev Wordpress
@leobalter
• Concatena JS e CSS
• Minimiza JS e CSS
• JSHint / JSLint
• Sass / LESS / Compass
• LiveReload
• Testes Unitários JS (QUnit, Jasmine, etc)
• etc, etc, etc
Automação
w3 total cache?
Instalação
•Node.JS + NPM (Node Package
Manager)
•npm install -g grunt-cli
•npm install -g grunt-init
2 arquivos
•Gruntfile.js
•package.json
http://blog.caelum.com.br/automacao-de-build-de-front-end-com-grunt-js/
module.exports = function(grunt) {
  grunt.initConfig({
     uglify: {
        'build/home.js': 'src/home.js',
        'build/main.js': 'src/main.js'  
     }
  });
 
  // carrega plugins
  grunt.loadNpmTasks('grunt-contrib-uglify');
};
Gruntfile.js
package.json
{
  "name": "meu-tema",
  "version": "0.0.1"
}
Preguiça
templates
grunt-wp-plugin
grunt-wp-theme
git clone git@github.com:10up/grunt-wp-plugin.git ~/.grunt-init/wp-plugin
git clone git@github.com:10up/grunt-wp-theme.git ~/.grunt-init/wp-theme
/assets
.. /css
.. .. /src
.. .. /sass
.. /js
.. .. /src
/images
.. /src
/includes
/languages
.. theme.pot
footer.php
functions.php
header.php
humans.txt
index.php
screenshot.png
style.css
grunt-init wp-theme
npm install
grunt
grunt watch
Links:
• https://mondaybynoon.com/grunt-
wordpress-theme-development/
• http://10up.com/blog/grunt-for-wordpress/
• http://mattbanks.me/grunt-wordpress-
development-deployments/

GruntJS + Wordpress