I am building a website using requireJS.
this is the first time i use requireJS.
i configured requireJS with paths in main.js:
require.config({ paths: { 'jquery': 'libs/jquery/1.7.2/jquery', 'underscore': 'libs/underscore/1.3.3-amdjs/underscore', // AMD support 'backbone': 'libs/backbone/0.9.2-amdjs/backbone', // AMD support 'marionette': 'libs/marionette/0.9.3-amd/backbone.marionette', // AMD support 'templates': '../templates' } });
and in the models, presentations, collections that I use;
define([ 'jquery', 'backbone' ], function ($) { var Geo = Backbone.Model.extend({}); return Geo; });
which I donβt understand: why should I continue to define jquery and the spine as a dependency. I mean this project, and models will never work without jquery / backbone.
so why not add jquery and basebode to index.html as script tags and keep links to them in each object. I understand that it will pollute the global namespace, but is it not so reasonable?
any recommendations.
amuses
source share