@@ -3,7 +3,7 @@ import fetch from '@webreflection/fetch';
33import { createProgress , writeFile } from './_utils.js' ;
44import { getFormat , loader , loadProgress , registerJSModule , run , runAsync , runEvent } from './_python.js' ;
55import { stdio , buffered } from './_io.js' ;
6- import { absoluteURL , fixedRelative } from '../utils.js' ;
6+ import { absoluteURL , fixedRelative , js_modules } from '../utils.js' ;
77import mip from '../python/mip.js' ;
88import { zip } from '../3rd-party.js' ;
99
@@ -37,6 +37,7 @@ export default {
3737 url = url . replace ( / \. m ? j s $ / , '.wasm' ) ;
3838 progress ( 'Loading MicroPython' ) ;
3939 const interpreter = await get ( loadMicroPython ( { linebuffer : false , stderr, stdout, url } ) ) ;
40+ globalThis [ js_modules ] . set ( '__transform__' , this . transform . bind ( this , interpreter ) ) ;
4041 const py_imports = importPackages . bind ( this , interpreter , baseURL ) ;
4142 loader . set ( interpreter , py_imports ) ;
4243 await loadProgress ( this , progress , interpreter , config , baseURL ) ;
0 commit comments