MCPcopy Create free account
hub / github.com/SplootCode/splootcode / tryNonModuleLoadPyodide

Function tryNonModuleLoadPyodide

packages/runtime-python/src/pyodide.ts:4–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { StaticURLs } from './static_urls'
3
4export function tryNonModuleLoadPyodide() {
5 // If we're not in a module context (prod build is non-module)
6 // Then we need to imoprt Pyodide this way, but it fails in a module context (local dev).
7 if (importScripts) {
8 try {
9 importScripts('https://cdn.jsdelivr.net/pyodide/v0.21.3/full/pyodide.js')
10 } catch (e) {
11 console.warn(e)
12 }
13 }
14}
15
16export async function tryModuleLoadPyodide() {
17 // @ts-ignore

Callers 2

webworker.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected