a grunt task plugin to run preen


a grunt task plugin to run preen

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-preen --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:


Configuration is done by adding a preen property to your projects bower.json file as explained here. You can also add arguments via the data object passed into grunt.initConfig().

In this example, preen is added to the default task in Gruntfile.js.

grunt.registerTask('default', ['myTask', 'preen']);

or it can be runn via cli

grunt preen

The only targets currently provided by preen are the preen:preview target that logs what actions would have been taken if preen was run

grunt preen:preview

and preen:verbose that logs all actions as they are run

grunt preen:verbose

The only option currently provided by preen is the directory option. This allows you to override bower's default directory (or the one set in .bowerrc). This can be useful when using preen as part of your build pipeline. This can be added via the data object passed to grunt.initConfig()

options: {
    directory: '.tmp/public/bower/files'

or it can be passed via the cli

grunt preen --directory ./tmp/public/bower/files

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

  • Aug 9, 2013 v1.0.0 preen and grunt-preen are ready to roll
  • Nov 11, 2014 v1.1.0
    • updated to accept both preview and verbose options
  • Jan 30, 2015 v1.2.0
    • updated to accept new directory option