" package.json "

Using Grunt with grunt-replace to replace handlebars/mustache with package.json variables

Recently while¬†testing out some Node.js modules for Grunt I came across grunt-replace, and my first though was, this would be great for setting up boilerplate PHP files for my WordPress plugins. ¬†Because I already set the name, slug, version, and other details in the¬† package.json¬†file, it would be great to use a template I could create for PHP files and just use Grunt to take the details from ¬† package.json¬†¬†and setup my base plugin files using a template syntax like Handlebars or Mustache. ¬†Luckily for me it worked out perfectly, but did require a little bit of troubleshooting and head scratching, but here’s how to make it work … (more…)