From b448363d9072420543f474c19ca4a24f18eb7ed4 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Fri, 24 Sep 2021 18:52:21 +0530 Subject: [PATCH] Include JS for *just* the bootstrap components we use This reduces our bundle size from 488 KB to 452 KB with barely any effort on our part Ref https://github.com/jupyterhub/binderhub/issues/1373 --- binderhub/static/js/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binderhub/static/js/index.js b/binderhub/static/js/index.js index 995d521e8..b3afc6f8a 100644 --- a/binderhub/static/js/index.js +++ b/binderhub/static/js/index.js @@ -13,7 +13,6 @@ import { Terminal } from 'xterm'; import { FitAddon } from 'xterm-addon-fit'; import ClipboardJS from 'clipboard'; -import 'bootstrap'; import 'event-source-polyfill'; import BinderImage from './src/image'; @@ -22,8 +21,12 @@ import { getPathType, updatePathText } from './src/path'; import { nextHelpText } from './src/loading'; import 'xterm/css/xterm.css'; + +// Include just the bootstrap components we use +import 'bootstrap/js/dropdown'; import 'bootstrap/dist/css/bootstrap.min.css'; import 'bootstrap/dist/css/bootstrap-theme.min.css'; + import '../index.css'; const BASE_URL = $('#base-url').data().url;