Howto bootstrap backbone app with yoman with require.js included

I play with yomen for a while. I wonder how I can load the Backbone application and enable require.js at the same time.

yeoman init 

provides me with a setup where I can work with AMD-style modules.

 yeoman init backbone:all 

provides me with a Backbone framework, but I had to β€œinclude” all my models, collection, etc. manually in index.html.

Is there a way to have both?

Regards, Felix

+7
source share
4 answers

An issue is already open here. Add your thoughts there :)

+2
source

We updated the Yeoman generation generator to support RequireJS . But it is not officially added to npm. But you can try it using

 npm install git://github.com/yeoman/generator-backbone.git 

Discussion: Not found in npm installation

The base generator supports yeoman 1.0beta. Try

 yo backbone 

You will receive a conditional invitation for RequireJS.

UPDATE 1

Trunk generator is available at npm.
Try npm install generator-backbone

UPDATE 2
RequireJS with option --coffee now supported in trunk generator v0.2.2

+5
source

Hi, I developed a generator for this, see https://github.com/abiee/generator-backbone-amd

+1
source

I tried the same thing today. In the end, I eventually had to complete the Johann Inn. Again, yoman sets the basic foundation. The console will ask if you want to override the files. Do not override main.js and index.html. You can relax.

It will not give you a perfect start. But most things will be in place.

0
source

All Articles