diff --git a/webpack.config.js b/webpack.config.js index ddfaf52e..4d8f7619 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -18,6 +18,11 @@ module.exports = { publicPath: "https://unpkg.com/thebelab@" + pkg.version + "/lib/", }, plugins: [ + // get slim jQuery + new webpack.NormalModuleReplacementPlugin( + /jquery$/, + "jquery/dist/jquery.slim.js" + ), // Not using moment shim(/moment/), // Don't need vim keymap @@ -27,24 +32,39 @@ module.exports = { shim(/elliptic/), shim(/bn\.js/), shim(/readable\-stream/), + // can we get away without react-dom? + shim(/react\-dom/), + // skip postcss + shim(/postcss/), + shim(/font\-awesome/), + // shim(/ajv/), + // shim(/lodash/), // shim(/@phosphor\/coreutils\/lib\/random/), // shim out some unused phosphor shim( - /@phosphor\/widgets\/lib\/(commandpalette|box|dock|grid|menu|scroll|split|stacked|tab).*/ + /@phosphor\/widgets\/lib\/(box|commandpalette|contextmenu|dock|grid|menu|scroll|split|stacked|tab).*/ ), + shim(/@phosphor\/collections\/lib\/(bplustree).*/), shim(/@phosphor\/(dragdrop|commands).*/), // unused @jupyterlab - shim(/@jupyterlab\/apputils/), - // shim(/@jupyterlab\/apputils\/lib\/(clientsession|dialog|mainmenu|instancetracker|sanitizer|toolbar)/), + // shim(/@jupyterlab\/apputils/), + shim( + /@jupyterlab\/apputils\/lib\/(clientsession|dialog|instancetracker|mainareawidget|mainmenu|thememanager|toolbar|widgettracker)/ + ), // shim(/@jupyterlab\/apputils\/style\/.*/), // JupyterLab's codemirror package is also big, // but not so trival to shim + // we only need CodeMirrorEditor.defaultConfig to be defined, as far as I can tell // shim(/@jupyterlab\/codemirror\/lib\/editor/), shim(/@jupyterlab\/codeeditor\/lib\/jsoneditor/), shim(/@jupyterlab\/coreutils\/lib\/(time|settingregistry|.*menu.*)/), shim(/@jupyterlab\/services\/lib\/(contents|terminal)\/.*/), + shim(/@jupyterlab\/statusbar\/.*/), + shim(/@jupyterlab\/theme-light-extension\/style\/(icons|images)\/.*/), + shim(/@jupyterlab\/theme-light-extension\/style\/(urls).css/), + new BundleAnalyzerPlugin({ analyzerMode: "static", openAnalyzer: false,