backbone boilerplate code and building with grunt bbb

1.8k views Asked by At

I've been following Addy Osmani's guide on using grunt and the bbb plugin to build a small backbone.js app. However, I am still confused about a couple of things. For instance, after running "bbb init" my page will not load. I get reference errors on both the css and require.js files.

I am building in a LAMP environment (MAMP on OSX). I know grunt-bbb can work off of Node.js but does it have to? Backbone after all is a client side mvc framework, so I believe it should work. When I run "bbb server" to start the development server, then everything seems fine. But I won't be able to deploy to a node server. I have to host my app on Apache.

1

There are 1 answers

2
Simon Boudrias On BEST ANSWER

Are you running your app in a subfolder? (e.g.: localhost/my/app) Or to the root?

Backbone-Boilerplate set the app.root value to / by default. If you're running in a subfolder, you'll need to update the value here: https://github.com/tbranyen/backbone-boilerplate/blob/master/app/app.js#L14

Also update files path in index.html (line 13 and line 33)

If you're not using pushState, you can set the value to an empty string. Otherwise, add the root folder.