Table of Contents
Steps
- 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
To add to LMS:
- Add to the `lms/env/common.py` at https://github.com/edx/edx-platform/blob/master/lms/envs/common.py#L1246
- Add to the `lms/static/js/require-config.js` at https://github.com/edx/edx-platform/blob/master/lms/static/lms/js/require-config.js#L51
- If you can't use NPM for some reason, then do the following instead:
- Check in the file into
common/static/vendor
- Check in the file into
Add the path of the new library in the
node_modules
to https://github.com/edx/edx-platform/blob/master/pavelib/assets.py#L43
See Also
- This PR updates a library to use npm so touches most of the relevant files: