Skip to content

Commit 80c86ec

Browse files
committed
Fix documentation bundling
1 parent 7835d47 commit 80c86ec

File tree

6 files changed

+6
-22
lines changed

6 files changed

+6
-22
lines changed

docs/source/_static/helper.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
var cache_require = window.require;
2-
3-
window.addEventListener('load', function() {
4-
window.require = cache_require;
5-
});

docs/source/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,9 @@ def setup(app):
208208
finally:
209209
os.chdir(popd)
210210

211-
212211
app.setup_extension('jupyter_sphinx.embed_widgets')
213212
def add_scripts(app):
214-
for fname in ['helper.js', 'jupyter-threejs.js', 'three.js']:
213+
for fname in ['jupyter-threejs.js']:
215214
if not os.path.exists(os.path.join(here, '_static', fname)):
216215
app.warn('missing javascript file: %s' % fname)
217216
app.add_javascript(fname)

js/scripts/copy-files.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,10 @@ function copyBundleToDocs() {
3131
});
3232
}
3333

34-
function copyThreeToDocs() {
35-
return fse.copy(
36-
path.resolve(threeBuildDir, 'three.js'),
37-
path.resolve(docStaticDir, 'three.js')
38-
).then(function() {
39-
console.log('Copied three.js to docs folder');
40-
});
41-
}
42-
4334
if (require.main === module) {
4435
// This script copies files after a build
4536
Promise.all([
4637
copyThree(),
4738
copyBundleToDocs(),
48-
copyThreeToDocs(),
4939
]);
5040
}

js/src/embed.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var threejs_semver = require('../package.json')['dependencies']['three'];
2-
if (window.require) {
3-
window.require.config({
2+
if (window.requirejs) {
3+
window.requirejs.config({
44
paths: {
55
'three': ['three', 'https://unpkg.com/three@' + threejs_semver + '/build/three.min.js']
66
}

js/src/extension.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ __webpack_public_path__ = document.querySelector('body').getAttribute('data-base
99

1010

1111
// Configure requirejs
12-
if (window.require) {
13-
window.require.config({
12+
if (window.requirejs) {
13+
window.requirejs.config({
1414
map: {
1515
'*' : {
1616
'jupyter-threejs': 'nbextensions/jupyter-threejs/index',

js/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = [
4040
libraryTarget: 'amd'
4141
},
4242
devtool: 'source-map',
43-
externals: externals,
43+
externals: ['@jupyter-widgets/base'],
4444
resolve: {
4545
extensions: [ ".autogen.js", ".js" ]
4646
},

0 commit comments

Comments
 (0)