index.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. import { PageConfig } from '@jupyterlab/coreutils';
  4. // eslint-disable-next-line
  5. __webpack_public_path__ = PageConfig.getOption('fullStaticUrl') + '/';
  6. // This must be after the public path is set so CSS assets can load properly.
  7. import('./build/style.js');
  8. // These imports should match the list of extensions in package.json (listed
  9. // separately there so the webpack config Build.ensureAssets step can copy
  10. // extension assets to the build directory). These import statements assume
  11. // the JupyterLab plugins are the default export from each package.
  12. const extensions = [
  13. import('@jupyterlab/application-extension'),
  14. import('@jupyterlab/apputils-extension'),
  15. import('@jupyterlab/codemirror-extension'),
  16. import('@jupyterlab/completer-extension'),
  17. import('@jupyterlab/console-extension'),
  18. import('@jupyterlab/csvviewer-extension'),
  19. import('@jupyterlab/docmanager-extension'),
  20. import('@jupyterlab/filebrowser-extension'),
  21. import('@jupyterlab/fileeditor-extension'),
  22. import('@jupyterlab/help-extension'),
  23. import('@jupyterlab/imageviewer-extension'),
  24. import('@jupyterlab/inspector-extension'),
  25. import('@jupyterlab/launcher-extension'),
  26. import('@jupyterlab/mainmenu-extension'),
  27. import('@jupyterlab/markdownviewer-extension'),
  28. import('@jupyterlab/mathjax2-extension'),
  29. import('@jupyterlab/notebook-extension'),
  30. import('@jupyterlab/rendermime-extension'),
  31. import('@jupyterlab/running-extension'),
  32. import('@jupyterlab/settingeditor-extension'),
  33. import('@jupyterlab/shortcuts-extension'),
  34. import('@jupyterlab/statusbar-extension'),
  35. import('@jupyterlab/terminal-extension'),
  36. import('@jupyterlab/theme-dark-extension'),
  37. import('@jupyterlab/theme-light-extension'),
  38. import('@jupyterlab/tooltip-extension'),
  39. import('@jupyterlab/translation-extension'),
  40. import('@jupyterlab/ui-components-extension')
  41. ];
  42. window.addEventListener('load', async function () {
  43. const JupyterLab = import('@jupyterlab/application').JupyterLab;
  44. const lab = new JupyterLab();
  45. lab.registerPluginModules(extensions);
  46. /* eslint-disable no-console */
  47. console.log('Starting app');
  48. await lab.start();
  49. console.log('App started, waiting for restore');
  50. await lab.restored;
  51. console.log('Example started!');
  52. });