Okay, this looks like a RequireJS configuration. Let’s break down what it means.
Overall Structure
This is a JavaScript object that defines how the RequireJS module loader should handle dependencies and load scripts. It’s essentially a map telling RequireJS where to find modules and how they relate to each other.
Key sections
-
paths: this is the most crucial part.It defines aliases for module names and their corresponding file paths.
"underscore-1.5.1": {"exports": ""},: This means that the module named "underscore-1.5.1" can be loaded, and when it's loaded, it will expose its contents as the global variable (underscore). the exports property tells RequireJS what to make available as the module's return value.
"fly/libs/backbone-1.0.0": {"deps": ["version!fly/libs/underscore", "jquery"], "exports": "Backbone"},: This defines the backbone module.
deps: This lists the dependencies that backbone requires. It needs underscore (specifically the version fly/libs/underscore) and jquery. The version! prefix is a requirejs plugin that likely handles versioning or specific loading of a module.
exports: When backbone is loaded, its contents will be exposed as the global variable backbone.
<
Okay, this looks like a RequireJS configuration. Let's break down what it means.
Overall Structure
This is a JavaScript object that defines how the RequireJS module loader should handle dependencies and load scripts. It's essentially a map telling RequireJS where to find modules and how they relate to each other.
Key sections
-
paths: this is the most crucial part.It defines aliases for module names and their corresponding file paths.
"underscore-1.5.1": {"exports": ""},: This means that the module named "underscore-1.5.1" can be loaded, and when it's loaded, it will expose its contents as the global variable (underscore). the exports property tells RequireJS what to make available as the module's return value.
"fly/libs/backbone-1.0.0": {"deps": ["version!fly/libs/underscore", "jquery"], "exports": "Backbone"},: This defines the backbone module.
deps: This lists the dependencies that backbone requires. It needs underscore (specifically the version fly/libs/underscore) and jquery. The version! prefix is a requirejs plugin that likely handles versioning or specific loading of a module.
exports: When backbone is loaded, its contents will be exposed as the global variable backbone.
"libs/jquery/ui/jquery.ui.tabs-1.11.4": ["jquery", "version!libs/jquery/ui/jquery.ui.core", "version!fly/libs/jquery.widget"],: This defines the jquery.ui.tabs module. It depends on jquery,jquery.ui.core, and jquery.widget.
"libs/jquery/flexslider-2.1": ["jquery"],: flexslider depends on jquery.
"libs/dataTables.fixedColumns-3.0.4": ["jquery", "version!libs/dataTables"],: dataTables.fixedColumns depends on jquery and dataTables.
"libs/dataTables.fixedHeader-2.1.2": ["jquery", "version!libs/dataTables"],: dataTables.fixedHeader depends on jquery and dataTables.
"https://sports.cbsimg.net/js/CBSi/app/VideoPlayer/AdobePass-min.js": ["https://sports.cbsimg.net/js/CBSi/util/Utils-min.js"]: AdobePass-min.js depends on Utils-min.js.
-
map: This section defines aliases for external scripts and libraries. It's used to map short, convenient names to full URLs.
"": { ... }: The "" means these aliases apply globally (to all modules).
"adobe-pass": "https://sports.cbsimg.net/js/CBSi/app/VideoPlayer/AdobePass-min.js",: You can now use "adobe-pass" in your require() calls rather of the full URL.
"facebook": "https://connect.facebook.net/enUS/sdk.js",: Alias for the Facebook SDK.
"facebook-debug": "https://connect.facebook.net/enUS/all/debug.js",: Alias for the Facebook Debug SDK.
"google": "https://apis.google.com/js/plusone.js",: Alias for Google Plus One. "google-csa": "https://www.google.com/adsense/search/async-ads.js",: Alias for Google Contextual Search Ads.
"google-javascript-api": "https://www.google.com/jsapi",: Alias for Google JavaScript API.
"google-client-api": "https://accounts.google.com/gsi/client",: Alias for Google Sign-In Client API.
"gpt": "https://securepubads.g.doubleclick.net/tag/js/gpt.js",: alias for Google Publisher Tag.
"hlsjs": "https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.0.7/hls.js",: Alias for HLS.js (for streaming).
"recaptcha": "https://www.google.com/recaptcha/api.js?onload=loadRecaptcha&render=explicit",: alias for
