Skip to content

Commit 4a61880

Browse files
committed
Do not bundle base and controls.
1 parent 6830eb5 commit 4a61880

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

js/manager.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import * as outputWidgets from './output';
1010
import { ShimmedComm } from './services-shim';
1111
import { createRenderMimeRegistryWithWidgets } from './renderMime';
1212

13+
if (typeof window !== "undefined" && typeof window.define !== "undefined") {
14+
window.define("@jupyter-widgets/base", base);
15+
window.define("@jupyter-widgets/controls", controls);
16+
}
17+
1318
export class WidgetManager extends HTMLManager {
1419
constructor(kernel, loader) {
1520
super();

js/webpack.config.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,5 @@ module.exports = [
4444
},
4545
module: { loaders: loaders },
4646
devtool: 'source-map'
47-
},
48-
49-
// Exports needed for custom widget libraries.
50-
{// @jupyter-widgets/base
51-
entry: '@jupyter-widgets/base/lib/index',
52-
output: {
53-
filename : 'base.js',
54-
path: path.resolve(distRoot, '@jupyter-widgets'),
55-
libraryTarget: 'amd'
56-
},
57-
module: { loaders: loaders }
58-
},
59-
{// @jupyter-widgets/controls
60-
entry: '@jupyter-widgets/controls/lib/index',
61-
output: {
62-
filename : 'controls.js',
63-
path: path.resolve(distRoot, '@jupyter-widgets'),
64-
libraryTarget: 'amd'
65-
},
66-
module: { loaders: loaders },
67-
externals: ['@jupyter-widgets/base']
6847
}
6948
]

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ class NPM(Command):
6666

6767
lib_root = os.path.join(here, 'voila', 'static', 'dist')
6868
targets = [
69-
os.path.join(lib_root, 'libwidgets.js'),
70-
os.path.join(lib_root, '@jupyter-widgets', 'base.js'),
71-
os.path.join(lib_root, '@jupyter-widgets', 'controls.js')
69+
os.path.join(lib_root, 'libwidgets.js')
7270
]
7371

7472
def initialize_options(self):
@@ -150,7 +148,6 @@ def run(self):
150148
'templates/*',
151149
'static/*',
152150
'static/dist/*',
153-
'static/dist/@jupyter-widgets/*',
154151
]
155152
},
156153
'entry_points': {

0 commit comments

Comments
 (0)