File tree Expand file tree Collapse file tree 6 files changed +6
-22
lines changed Expand file tree Collapse file tree 6 files changed +6
-22
lines changed Original file line number Diff line number Diff line change 1
- var cache_require = window . require ;
2
-
3
- window . addEventListener ( 'load' , function ( ) {
4
- window . require = cache_require ;
5
- } ) ;
Original file line number Diff line number Diff line change @@ -208,10 +208,9 @@ def setup(app):
208
208
finally :
209
209
os .chdir (popd )
210
210
211
-
212
211
app .setup_extension ('jupyter_sphinx.embed_widgets' )
213
212
def add_scripts (app ):
214
- for fname in ['helper.js' , ' jupyter-threejs.js' , 'three .js' ]:
213
+ for fname in ['jupyter-threejs.js' ]:
215
214
if not os .path .exists (os .path .join (here , '_static' , fname )):
216
215
app .warn ('missing javascript file: %s' % fname )
217
216
app .add_javascript (fname )
Original file line number Diff line number Diff line change @@ -31,20 +31,10 @@ function copyBundleToDocs() {
31
31
} ) ;
32
32
}
33
33
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
-
43
34
if ( require . main === module ) {
44
35
// This script copies files after a build
45
36
Promise . all ( [
46
37
copyThree ( ) ,
47
38
copyBundleToDocs ( ) ,
48
- copyThreeToDocs ( ) ,
49
39
] ) ;
50
40
}
Original file line number Diff line number Diff line change 1
1
var threejs_semver = require ( '../package.json' ) [ 'dependencies' ] [ 'three' ] ;
2
- if ( window . require ) {
3
- window . require . config ( {
2
+ if ( window . requirejs ) {
3
+ window . requirejs . config ( {
4
4
paths : {
5
5
'three' : [ 'three' , 'https://unpkg.com/three@' + threejs_semver + '/build/three.min.js' ]
6
6
}
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ __webpack_public_path__ = document.querySelector('body').getAttribute('data-base
9
9
10
10
11
11
// Configure requirejs
12
- if ( window . require ) {
13
- window . require . config ( {
12
+ if ( window . requirejs ) {
13
+ window . requirejs . config ( {
14
14
map : {
15
15
'*' : {
16
16
'jupyter-threejs' : 'nbextensions/jupyter-threejs/index' ,
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ module.exports = [
40
40
libraryTarget : 'amd'
41
41
} ,
42
42
devtool : 'source-map' ,
43
- externals : externals ,
43
+ externals : [ '@jupyter-widgets/base' ] ,
44
44
resolve : {
45
45
extensions : [ ".autogen.js" , ".js" ]
46
46
} ,
You can’t perform that action at this time.
0 commit comments