Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download web/scripts/test-esm-loader.mjs from fsanyoto/runloopable: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/spaces/fsanyoto/runloopable/resolve/main/web/scripts/test-esm-loader.mjs
- Command line
-
hf download hf://spaces/fsanyoto/runloopable/web/scripts/test-esm-loader.mjs
-
curl -L -o test-esm-loader.mjs https://huggingface.co/spaces/fsanyoto/runloopable/resolve/main/web/scripts/test-esm-loader.mjs
542 Bytes
| // Resolve TypeScript's extensionless ESM output for source-level Node gates. | |
| // Production is bundled by Vite; this loader gives the gate the same ESM semantics without | |
| // pretending the valid `import.meta.url` worker code is CommonJS. | |
| export async function resolve(specifier, context, nextResolve) { | |
| try { | |
| return await nextResolve(specifier, context); | |
| } catch (error) { | |
| if (specifier.startsWith(".") && !/\.[cm]?js(?:[?#]|$)/.test(specifier)) { | |
| return nextResolve(`${specifier}.js`, context); | |
| } | |
| throw error; | |
| } | |
| } | |