CaryLandholt/grunt-hustler — pull request #12 by tardyp (2013-05-27 19:19:34+00:00)
Title: add requiregen

you can use it like this:

# custom task that generates main.js (the require.js main file)
# Angular is actually very nice with its dependancy injection system
# basically, we just need angular is loaded first, app second and run last
# we should not be modifying this config when the app is growing
requiregen:
main:
cwd: './.temp/scripts/'
# require json2 and html5shiv are loaded in the html file
src: ['**/*.js','!libs/require.js', '!libs/json2.js', '!libs/html5shiv-printshiv.js']
options:
order: [
# order is a list of regular expression matching
# modules, requiregen will generate the correct shim
# to load modules in this order
# if a module has been loaded in previous layers, it wont be loaded again
# so that you can use global regular expression in the end
'libs/jquery'
'libs/angular' # angular needs jquery before or will use internal jqlite
'libs/.*' # remaining libs before app
'app' # app needs libs
'(routes|views|config)'
'.*/.*' # remaining angularjs components
'run' # run has to be in the end, because it is triggering angular's own DI
]
dest: '.temp/scripts/main.js'