Anyone using Grunt for WordPress theme development?

Just wondering who else is using Grunt for WordPress Theme Development?

I’ve been avoiding grunt for WordPress themes up until today, it’s quite cool. When I run grunt build it does the following:

  • Copy my theme files from /theme-name/ into /build/
  • Zips up /theme-name-child/ into /
  • Minify all javascript in /build/
  • Compresses all images in /build/
  • Adds new version numbers to /build/style.css (Theme Version) and /build/functions.php (enqueue script/style version numbers)
  • Adds correct textdomain to all function calls within /build/*.php files
  • Generates /build/languages/theme-name.pot
  • Zips up each of my custom theme plugins from /plugin-dev/theme-plugin-name/ into /build/plugins/ (so they can be activated with TGM upon theme installation)
  • Finally zips up /build/ folder into /

Things I’m trying to figure out now are:

  • How to automatically add my /plugin-dev/* theme plugins to the TGM activation options array within the theme. So if I make a new theme plugin in /plugin-dev/ it will be automatically added to the TGM config array.
  • Best way to deploy my file to a fresh WordPress installation for a quick test.

Anyone else here have a gruntfile they would like to share?


Hi Dave!

I’m using it as well - my grunt file doesn’t do more than what your currently does though.

Can you share your grunt file? Would like to see how you’re doing it :slightly_smiling:

Kind Regards! :slight_smile: