JPGygax68
7/23/2013 - 7:59 PM

Copy-paste example of a require.js configuration, including loading require.js from the "scripts" subdirectory. Indented two levels (2 spac

Copy-paste example of a require.js configuration, including loading require.js from the "scripts" subdirectory. Indented two levels (2 spaces per level) for correct insertion in the document header.

    <script type="text/javascript" src="scripts/require.js" data-main="app/main"></script>
    <script>
      requirejs.config({
        paths: {
          'underscore': 'lib/underscore',
          'jquery'    : 'lib/jquery-2.0.3',
          'backbone'  : 'lib/backbone',
          'relational': 'lib/backbone-relational',
          'css'       : 'lib/css.min'
        },
        shim: {
          underscore: {
            exports: '_'
          },
          backbone: {
            deps: ["underscore", "jquery"],
            exports: "Backbone"
          },
          relational: {
            deps: ["backbone"]
          }
        }
      });
    </script>