@@ -75,7 +75,6 @@ export class Bumble extends EventTarget {
7575 }
7676
7777 // Load the Bumble module
78- bumblePackage ||= 'bumble' ;
7978 console . log ( 'Installing micropip' ) ;
8079 this . log ( `Installing ${ bumblePackage } ` )
8180 await this . pyodide . loadPackage ( 'micropip' ) ;
@@ -166,15 +165,28 @@ export class Bumble extends EventTarget {
166165 }
167166}
168167
168+ async function getBumblePackage ( ) {
169+ const params = ( new URL ( document . location ) ) . searchParams ;
170+ // First check the packageFile override param
171+ if ( params . has ( 'packageFile' ) ) {
172+ return await ( await fetch ( '/packageFile' ) ) . text ( )
173+ }
174+ // Then check the package override param
175+ if ( params . has ( 'package' ) ) {
176+ return params . get ( 'package' )
177+ }
178+ // If no override params, default to the main package
179+ return 'bumble'
180+ }
181+
169182export async function setupSimpleApp ( appUrl , bumbleControls , log ) {
170183 // Load Bumble
171184 log ( 'Loading Bumble' ) ;
172185 const bumble = new Bumble ( ) ;
173186 bumble . addEventListener ( 'log' , ( event ) => {
174187 log ( event . message ) ;
175188 } )
176- const params = ( new URL ( document . location ) ) . searchParams ;
177- await bumble . loadRuntime ( params . get ( 'package' ) ) ;
189+ await bumble . loadRuntime ( await getBumblePackage ( ) ) ;
178190
179191 log ( 'Bumble is ready!' )
180192 const app = await bumble . loadApp ( appUrl ) ;
0 commit comments