Skip to content

Commit

Permalink
Ensure js_modules are loaded in pyodiode (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Apr 9, 2024
1 parent 8887df0 commit b332852
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nbsite/pyodide/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def extract_extensions(code: str) -> List[str]:
js += model.__javascript__
if hasattr(model, '__css__'):
css += model.__css__
if hasattr(model, '__javascript_module__'):
js_modules.update({
jsm.split("/")[-1][:-3]: jsm for jsm in model.__javascript_modules__
if jsm.endswith('.js')
})
if hasattr(model, '__javascript_module_exports__'):
js_exports.update(
dict(zip(model.__javascript_module_exports__,
Expand Down

0 comments on commit b332852

Please sign in to comment.