How to add a new third party JavaScript library to LMS or Studio

Table of Contents

Install the Library

  • Our preference is to install all JavaScript libraries using npm:
    • See if it can be found here: https://www.npmjs.com/
    • If so, update edx-platform's package.json file to reference the library
      • Be sure to use the "~" prefix for the version to allow patches to be picked up automatically
      • For more details about versioning, see: http://semver.org/
    • Execute the following to have your library installed:

      paver install_prereqs
    • Add your new library to the list of NPM-installed libraries:
    • Execute the following to have your library available as a Django static asset (choose LMS or Studio or both as appropriate):

      paver update_assets lms --settings=devstack
  • Add the new library to the list of vendor libraries that are installed by update_assets:

  • If you can't use NPM for some reason, then do the following instead:
    • Check in the file to common/static/vendor

Use the Library

See Also