Skip to content

Commit dacccfb

Browse files
committed
Change distribution layout for JS
1 parent c8bbcdc commit dacccfb

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def setup(app):
211211

212212
app.setup_extension('jupyter_sphinx.embed_widgets')
213213
def add_scripts(app):
214-
for fname in ['helper.js', 'jupyter-threejs.js']:
214+
for fname in ['helper.js', 'jupyter-threejs.js', 'three.js']:
215215
if not os.path.exists(os.path.join(here, '_static', fname)):
216216
app.warn('missing javascript file: %s' % fname)
217217
app.add_javascript(fname)

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "jupyter - threejs bridge",
55
"author": "Jupyter-Threejs development team",
66
"license": "BSD-3-Clause",
7-
"main": "src/index.js",
7+
"main": "dist/index.js",
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/jovyan/pythreejs.git"

js/scripts/copy-files.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const docStaticDir = path.resolve(baseDir, '..', 'docs', 'source', '_static');
1515

1616
function copyThree() {
1717
return fse.copy(
18-
path.resolve(threeBuildDir, 'three.js'),
18+
path.resolve(threeBuildDir, 'three.min.js'),
1919
path.resolve(staticDir, 'three.js')
2020
).then(function() {
2121
console.log('Copied three.js to static folder');
@@ -31,10 +31,20 @@ function copyBundleToDocs() {
3131
});
3232
}
3333

34+
function copyThreeToDocs() {
35+
return fse.copy(
36+
path.resolve(threeBuildDir, 'three.min.js'),
37+
path.resolve(docStaticDir, 'three.js')
38+
).then(function() {
39+
console.log('Copied three.js to docs folder');
40+
});
41+
}
42+
3443
if (require.main === module) {
3544
// This script copies files after a build
3645
Promise.all([
3746
copyThree(),
3847
copyBundleToDocs(),
48+
copyThreeToDocs(),
3949
]);
4050
}

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: ['@jupyter-widgets/base'],
43+
externals: externals,
4444
resolve: {
4545
extensions: [ ".autogen.js", ".js" ]
4646
},

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
'js/src/core/BufferAttribute.autogen.js',
4949
name + '/core/BufferAttribute_autogen.py',
5050
'docs/source/_static/jupyter-threejs.js',
51+
'docs/source/_static/three.js',
5152
]),
5253
)
5354

0 commit comments

Comments
 (0)