Advertisement
Guest User

common.js

a guest
Aug 7th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * The main requirejs configuration (except for baseUrl)
  3.  *
  4.  * This file is included in ::_requirejs.html.twig and in Gruntfile.js. The
  5.  * baseUrl is not here so we can dynamically vary it in ::_requirejs.html.twig
  6.  */
  7. requirejs.config({
  8.     paths: {
  9.         /**
  10.          * Paths are relative to baseUrl, which should be set before including
  11.          * this file to the web/assets directory.
  12.          */
  13.         domReady: '../vendor/requirejs-domready/domReady',
  14.         /**
  15.          * Things like this only work because the library has code in it to
  16.          * detect if require.js is present, and manually register the module
  17.          * if it is. Normally, if a library you're including doesn't support
  18.          * AMD, you will likely need a paths entry and also an entry in
  19.          * shim (beyond what you see for the bootstrap shim).
  20.          */
  21.         jquery: '../vendor/jquery/dist/jquery.min',
  22.         bootstrap: '../vendor/bootstrap/dist/js/bootstrap.min',
  23.         underscore: '../vendor/underscore/underscore-min',
  24.         routing: '../../bundles/fosjsrouting/js/router'
  25.     },
  26.     shim: {
  27.         /**
  28.          * bootstrap does not support AMD. This means that require.js doesn't
  29.          * now that jquery needs to be downloaded first, before bootstrap.
  30.          * This accomplishes this.
  31.          *
  32.          * Unlike most modules, we don't actually care about receiving some
  33.          * sort of "bootstrap" object, we simply require the "bootstrap"
  34.          * module so that all of its jQuery plugins are available. If we
  35.          * needed to capture some sort of return object (like the $ in jQuery,
  36.          * except that it fortunately supports AMD), we would need to do
  37.          * a little more work here.
  38.          */
  39.         bootstrap: ['jquery'],
  40.         routing: {
  41.             exports: 'Routing'
  42.         },
  43.         routes: ['routing']
  44.     }
  45. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement