externals.js 1011 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. var helpers = require('./extension_helpers');
  4. /**
  5. * The externals provided to libraries
  6. * this package builds (like jupyter-js-widgets).
  7. */
  8. var BASE_EXTERNALS = [
  9. {
  10. 'jquery': '$',
  11. 'jquery-ui': '$'
  12. },
  13. helpers.createShimHandler('phosphor'),
  14. function(context, request, callback) {
  15. // CodeMirror imports get mangled to use an external bundle.
  16. var codeMirrorPaths = [
  17. 'codemirror/mode/meta',
  18. 'codemirror', '../lib/codemirror', '../../lib/codemirror',
  19. 'codemirror/lib/codemirror.css'
  20. ];
  21. if (codeMirrorPaths.indexOf(request) !== -1) {
  22. return callback(null, 'var jupyter.externals.codemirror');
  23. }
  24. callback();
  25. }
  26. ];
  27. /**
  28. * The externals that this package provides.
  29. */
  30. var EXTERNALS = BASE_EXTERNALS.concat([
  31. helpers.createShimHandler('jupyter-js-services')
  32. ]);
  33. module.exports = {
  34. BASE_EXTERNALS: BASE_EXTERNALS,
  35. EXTERNALS: EXTERNALS
  36. };