Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
RequireJs (r.js) plugin for grunt.js
JavaScript CSS

This branch is 14 commits ahead, 74 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

grunt-requirejs Build Status

Building require.js based applications with grunt

Getting Started

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, install this plugin with this command:

npm install grunt-requirejs --save-dev

Requirejs task

Run this task with the grunt requirejs command.

This task is a multi task so any targets, files and options should be specified according to the multi task documentation.


grunt-requirejs is capable of replacing require.js with almond.js automatically

For more infos please take a look at the Almond Integration document

Custom builds

grunt-requirejs can generate custom jQuery, Lo-Dash & Backbone.js versions during the optimization

For more infos please take a look at the Using Custom Builds document

Hybrid minification

grunt-requirejs can minify your optimized output files using an hybrid strategy utilitizing uglifyjs & closure compiler

For more infos please take a look at the Using Hybrid Builds document

Using custom r.js versions

grunt-requirejs lets you specify a custom r.js for your build

For more infos please take a look at the Using Custom r.js versions document

Using source maps

grunt-requirejs can generate sourcemaps when using the r.js v2.1.2 or higher

For more infos please take a look at the Using Source Maps document


There are some project & configuration examples to get you startet:


options object

This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.


For a full list of possible options, see the r.js example build file.

Release History

  • 2012-12-27   v0.3.2   Fixes issue 25 (Using almond results in “define is not defined” (when using the compiled main.js))
  • 2012-12-13   v0.3.1   Fixes issue 40 (Error messages eaten by 0.3.0) Fixes issue 36 (npm issue installing grunt-requirejs 0.3.0) Fixes issue 38 (Task won't run anymore on v0.3.0) Examples are now converted to grunt 0.4.0
  • 2012-12-03   v0.3.0   Major refactoring Support for custom builds Support for hybrid builds Support for custom requirejs versions Now multitask Support for removeCombined
  • 2012-10-01   v0.2.14   fixes package.json dependecy versions
  • 2012-10-01   v0.2.13   fixes according to the changes from the last cheerio release
  • 2012-09-25   v0.2.12   fixes issue of r.js almond-based dependency mixup (added by @chrissrogers)
  • 2012-09-13   v0.2.11   Fixed issue Added example projects
  • 2012-09-10   v0.2.10   Fixed issue Fixed issue
  • 2012-07-10   v0.2.9   Removed jQuery dependency and replaced it with cheerio Updated versions of 3rd party libs
  • 2012-05-29   v0.2.8   RequireJS Version bump to 2.0
  • 2012-05-29   v0.2.7   Removed npm dependency for tracing the almond file Added some informations in the readme about the almond 'wrap=true'
  • 2012-05-21   v0.2.6   Added 'modulePath' configuration option for specifying your modules path Added 'modulePath' documentation
  • 2012-05-20   v0.2.5   Added dual config Optimized almond integration (removed npm dependency) Readme updates requirejs isnt a multi task anymore
  • 2012-05-08   v0.2.0   Removed clearTarget (use grunt-contrib clean instead) Added almond integration Added automatic almond js module script tag replacement for html files Improved documentation
  • 2012-04-23   v0.1.0   Initial Release

Task submitted by Sebastian Golasch

This file was generated on Tue Dec 18 2012 15:16:16.

Something went wrong with that request. Please try again.