Ensure minified pyscript is captured by query selector (#393)

This commit is contained in:
Philipp Rudiger
2022-05-16 16:40:23 +02:00
committed by GitHub
parent 8c65cad209
commit 1e8aa87b0a

View File

@@ -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());