Answering the question. From the RequireJS website:
//THIS WILL FAIL define(['require'], function (require) { var namedModule = require('name'); });
This fails because requirejs must download and execute all the dependencies before calling the factory function above. [...] So, either do not go into the array of dependencies, or if you are using an array of dependencies, list all the dependencies in it.
My decision:
// Modules configuration (modules that will be used as Jade helpers) define(function () { return { 'moment': 'path/to/moment', 'filesize': 'path/to/filesize', '_': 'path/to/lodash', '_s': 'path/to/underscore.string' }; });
Loader:
define(['jade', 'lodash', 'config'], function (Jade, _, Config) { var deps;
gremo Jul 03 '13 at 13:06 on 2013-07-03 13:06
source share