Skip to content

Instantly share code, notes, and snippets.

@jzaefferer
Created June 5, 2012 11:49
Show Gist options
  • Save jzaefferer/198fc8dd152893bac1fe to your computer and use it in GitHub Desktop.
Save jzaefferer/198fc8dd152893bac1fe to your computer and use it in GitHub Desktop.
requirejs: {
almond: true,
replaceRequireScript: [{
files: ['index.php'],
modulePath: '/js/main-built'
}],
wrap: true,
baseUrl: "js",
paths: {
'hbs': 'libs/hbs',
'Handlebars': 'libs/Handlebars',
'Backbone': 'libs/backbone',
'underscore': 'libs/underscore',
'bootstrap': 'libs/bootstrap',
'json2': 'libs/json2',
'Rickshaw': 'libs/rickshaw',
'validate': 'libs/jquery.validate'
},
hbs: {
templateExtension : 'hbs',
stylesDir : '/static/css/',
disableI18n: true
},
pragmasOnSave: {
excludeHbsParser: true,
excludeHbs: true,
excludeAfterBuild: true
},
modules: [{name: 'main'}],
out: "js/main-built.js",
uglify: {
except: ["$super"]
}
}
~/dev/console [git:development+] $ grunt build
Running "requirejs" task
>> RequireJS optimizer started
>> Including almond.js
Error: If the "modules" option is used, then there should be a "dir" option set and "out" should not be used since "out" is only for single file optimization output.
at Function.createConfig (/Users/jza/dev/console/node_modules/grunt-requirejs/node_modules/requirejs/bin/r.js:16178:19)
~/dev/console [git:development+] $ grunt build
Running "requirejs" task
>> RequireJS optimizer started
>> Including almond.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot call method 'forEach' of undefined
at Object.<anonymous> (/Users/jza/dev/console/node_modules/grunt-requirejs/tasks/require.js:192:29)
at Task.helper (/Users/jza/dev/console/node_modules/grunt/lib/util/task.js:117:19)
at Object.helper (native)
at Object.<anonymous> (/Users/jza/dev/console/node_modules/grunt-requirejs/tasks/require.js:72:11)
at Object.<anonymous> (/Users/jza/dev/console/node_modules/grunt/lib/grunt/task.js:56:16)
at Task.<anonymous> (/Users/jza/dev/console/node_modules/grunt/lib/util/task.js:341:36)
at Task.<anonymous> (/Users/jza/dev/console/node_modules/grunt/lib/util/task.js:317:9)
at Task.<anonymous> (/Users/jza/dev/console/node_modules/grunt/lib/util/task.js:344:11)
at Task.start (/Users/jza/dev/console/node_modules/grunt/lib/util/task.js:357:5)
at Object.tasks (/Users/jza/dev/console/node_modules/grunt/lib/grunt.js:143:8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment