In this article we will see the basics of the "Required.JS" plugin and how to implement the various options of "Required.JS".
PrettyPhoto sample page
Comment the existing script references in the Master page and add the Require JS file. The data-main attribute on the script tag for require.js tells Require JS to load the scripts/main.js file. Require JS will load any dependency that is passed to require () without a ".js" file from the same directory as the one used for data-main.
In the calendar page, just change the script as mentioned below to load only the required "datapick.js" file.
In the calendar page we will see that only the Require JS, main.js and datepick.js files are loaded.
In the Prettyphoto page the script to load only the required "PrettyPhtoto.JS" was also changed.