Understanding new grunt watch/dev/build in v7.0

You need to add define('WP_ENV', 'development'); to your wp-config.php, while developing, so your Roots won’t look for the minified version.

  • grunt dev basically will do all the work but* minifying;
  • grunt watch will run grunt dev when something is modified;
  • grunt build will do all the work + minify, so you can send your project to your production server.

The process as I understand:

  1. Add define('WP_ENV', 'development'); to wp-config.php;
  2. Work on your project with grunt watch;
  3. Finishes the project -> runs grunt build;
  4. Send the project to production server (where the WP_ENV won’t be “development”).

http://discourse.roots.io/t/how-to-correctly-add-bxslider-to-my-theme/1952/12?u=heitorss

1 Like