If you're specifying individual modules to include in jam's compiled output, you can make it easier to manage by using a single, top-level module for your application. This module should include all the other modules and top-level dependencies you need. Then, when doing jam compile you need only specify this file and Jam will find all the dependencies from there.
define('myapp/app', [
'jquery',
'myapp/foo'
],
function ($, foo) {
return {
init: function () {
// add you app initialization code here
// ...
}
};
});<script src="jam/require.js"></script>
<script>
require(['myapp/app'], function (app) {
app.init();
});
</script>Then, to include all the immediately required files into a single download, simply do:
$ jam compile -i myapp/app -o output.jsBy doing it this way, you can add that command to your build script and not have to update it when your app's dependencies or module structure changes. Instead, you just manage compiled dependencies in myapp/app.js.