From b332852bcaa798f4d2974437996d7e611bb18d94 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Tue, 9 Apr 2024 12:04:58 +0200 Subject: [PATCH] Ensure js_modules are loaded in pyodiode (#306) --- nbsite/pyodide/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nbsite/pyodide/__init__.py b/nbsite/pyodide/__init__.py index 75f0588..f1501db 100644 --- a/nbsite/pyodide/__init__.py +++ b/nbsite/pyodide/__init__.py @@ -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__,