mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
Ensure minified pyscript is captured by query selector (#393)
This commit is contained in:
@@ -22,7 +22,7 @@ const loadInterpreter = async function (indexUrl:string): Promise<any> {
|
||||
|
||||
// let's get the full path of where PyScript is running from so we can load the pyscript.py
|
||||
// file from the same location
|
||||
const loadedScript: HTMLScriptElement = document.querySelector(`script[src$='pyscript.js']`);
|
||||
const loadedScript: HTMLScriptElement = document.querySelector(`script[src$='pyscript.js'], script[src$='pyscript.min.js']`);
|
||||
const scriptPath = loadedScript.src.substring(0, loadedScript.src.lastIndexOf('/'));
|
||||
await pyodide.runPythonAsync(await (await fetch(`${scriptPath}/pyscript.py`)).text());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user