You've got an app written using AMD and require.js. You'd love to use ampersand and all its awesomeness. How do you do it?
I propose an example for those in my situation, using the solution I found useful. Basically I used browerify in my build process to process a simple proto file.
// using nicer define vs the array type definition
define(function(require){
var Ampersand = require('ampersand');
var MyModel = Ampersand.Model.extend({
/// model def
});
return MyModel;
});
Proposed example would flesh this out with a real project. But mostly with a heavy emphasis on the readme.md since everyone's require.js configuration is slightly different.
You've got an app written using AMD and require.js. You'd love to use ampersand and all its awesomeness. How do you do it?
I propose an example for those in my situation, using the solution I found useful. Basically I used browerify in my build process to process a simple
proto
file.I then run browserify in my gulp as a dependent task:
and config require.js to use
ampersand
in its config file:Then use happily:
Proposed example would flesh this out with a real project. But mostly with a heavy emphasis on the readme.md since everyone's require.js configuration is slightly different.