Using require.js with the requirejs api (r.js) for optimization/minification and needed to reorganize our directory structure (and, therefore, re-map everything in the requirejs config file/etc).
Result of attempting a compile (through node) is currently:
compiling js...<br />
/usr/local/www/site/build/node_modules/requirejs/bin/r.js:14174<br />
throw new Error(errorMsg);<br />
^
**Error: Error: Loader plugin did not call the load callback in the build: text**<br />
Module loading did not complete for: <br />
at Function.build.traceDependencies (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:15178:19)<br />
at build (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:14174:23)<br />
at requirejs.optimize.runBuild (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:15472:30)<br />
at Object.context.execCb (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:1692:33)<br />
at Object.Module.check (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:948:51)<br />
at Object.Module.enable.id (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:1181:34)<br />
at g (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:233:23)<br />
at Module.emit (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:1224:21)<br />
at each (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:165:31)<br />
at Object.Module.emit (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:1223:17)<br />
at Object.Module.check (/usr/local/www/site/build/node_modules/requirejs/bin/r.js:1002:30)<br />
Build call is:
var requirejs = require('requirejs');
var config = {
baseUrl: './public/js',
mainConfigFile: './public/js/config/config.js',
paths: {
'requireLib': 'library/require'
},
out: "./public/js/minified/main.js",
name: "minified/main",
wrap: false,
preserveLicenseComments: false,
deps: ["../js/local/main","modules/movie","modules/theatre"]
};
requirejs.optimize(config);
Config file is:
require.config({
paths: {
// JavaScript folders
libs: "library",
plugins: "plugin",
adminlibs: "../adminassets/js/plugins/ui",
// Libraries
jquery: "library/jquery",
jqcookie: "library/jquery.cookie",
jqui: "../adminassets/js/plugins/ui/jquery-ui-1.10.0.custom.min",
jqezmark: "library/jquery.ezmark",
jqcolor: "library/jquery.color",
underscore: "library/underscore-amdjs",
backbone: "library/backbone-amdjs",
chosen: "library/chosen.jquery",
moment: "library/moment",
// Plugins
text: "plugin/text",
async: "plugin/async",
datetimepicker: "../adminassets/js/plugins/ui/jquery.datetimepicker",
ajaxfileupload: "../adminassets/js/plugins/uploader/jquery.ajaxfileupload"
},
shim: {
'chosen': ['jquery'],
'jqcookie': ['jquery'],
'jqui': ['jquery'],
'jqezmark': ['jquery'],
'jqcolor': ['jquery'],
'jquifull' : ['jquery'],
'datetimepicker' : ['jqui'],
'ajaxfileupload' : ['jquery'],
'backbone': ['underscore','jquery']
},
// Initialize the application with the main application file
deps: ["local/main"]
});
Not really sure what's wrong here. The entire setup was working until I started moving files around ... but the compile process still finds all the files it needs ... it just hits the callback error listed above.
Turns out that updating my requirejs, text plugin, and r.js files resolved the issue.