Skip to content

AMD Modules vs Marionette's Modules

derickbailey edited this page May 24, 2012 · 2 revisions

Marionette provides it's own very simple module system, through the use of the .module method on Application instances.

MyApp = new Marionette.Application();

MyApp.module("MyModule", function(MyModule, MyApp, Backbone, Marionette, $, _){

  // do stuff here ...

  // see the full API Documentation for more info

});

The purpose of this module definition is to provide a simple alternative to RequireJS / AMD modules, and it is not recommended that you combine AMD and Marionette's modules. This would honestly not provide any value. If you're using AMD / RequireJS, stick with AMD / RequireJS.

Which Is Right For You?

If you're not using AMD / RequireJS, or another module definition system, Marionette's built in modules may be a good option for you. But if you're already using AMD / RequireJS, or another module system, then you should stick with that.