File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1+ // In an AMD module, we set the public path using the magic requirejs 'module' dependency
2+ // See https://github.com/requirejs/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#module
3+ // Since 'module' is a requirejs magic module, we must include 'module' in the webpack externals configuration.
4+ import * as module from 'module' ;
5+ const url = new URL ( module . uri , document . location ) ;
6+
7+ url . pathname = url . pathname . slice ( 0 , url . pathname . lastIndexOf ( '/voila/' ) ) ;
8+ __webpack_public_path__ = `${ url . origin } ${ url . pathname } /voila/templates/tiledb/static/babylonjs/` ;
Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
2- const version = require ( './package.json' ) . version ;
32
43// Custom webpack rules
54const rules = [
@@ -9,7 +8,7 @@ const rules = [
98] ;
109
1110// Packages that shouldn't be bundled but loaded at runtime
12- const externals = [ '@jupyter-widgets/base' ] ;
11+ const externals = [ '@jupyter-widgets/base' , 'module' ] ;
1312
1413const resolve = {
1514 // Add '.ts' and '.tsx' as resolvable extensions.
@@ -28,13 +27,13 @@ module.exports = [
2827 * the custom widget embedder.
2928 */
3029 {
31- entry : './src/embed.ts' ,
30+ entry : [ './amd-public-path.js' , './ src/embed.ts'] ,
3231 output : {
3332 filename : 'index.js' ,
3433 path : path . resolve ( __dirname , 'dist' ) ,
3534 libraryTarget : 'amd' ,
3635 library : "@tiledb-inc/pybabylonjs" ,
37- publicPath : 'https://unpkg.com/@tiledb-inc/pybabylonjs@' + version + '/dist/'
36+ publicPath : '' , // Set in amd-public-path.js
3837 } ,
3938 devtool : 'source-map' ,
4039 module : {
You can’t perform that action at this time.
0 commit comments