Download scripts/build/compose_app.mjs from VoiceOfML/Search: direct link, hf CLI and curl.
- Browser
- Download file 914 Bytes
-
https://huggingface.co/spaces/VoiceOfML/Search/resolve/main/scripts/build/compose_app.mjs
- Command line
-
hf download hf://spaces/VoiceOfML/Search/scripts/build/compose_app.mjs
-
curl -L -o compose_app.mjs https://huggingface.co/spaces/VoiceOfML/Search/resolve/main/scripts/build/compose_app.mjs
914 Bytes
| import { readFileSync } from "node:fs"; | |
| import { createRequire } from "node:module"; | |
| import { resolve } from "node:path"; | |
| import { pathToFileURL } from "node:url"; | |
| const resources = createRequire(import.meta.url)(resolve("static/reader-resources.js")); | |
| // The host list excludes the standalone Pages Worker and its dependencies. | |
| export const APP_DEPENDENCIES = Object.freeze([ | |
| "reader-resources.js", "reader/core/reader-contract.js", | |
| ...resources.searchHostFiles, | |
| ]); | |
| export function stripBundledScripts(html) { | |
| return html.replace(/<script\s+src="(?:\/?(?:search\/)?static\/)([^"\s]+)"\s*>\s*<\/script>\s*/g, | |
| (tag, filename) => APP_DEPENDENCIES.includes(filename) ? "" : tag); | |
| } | |
| if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) { | |
| process.stdout.write([...APP_DEPENDENCIES, "app.js"] | |
| .map(file => readFileSync("static/" + file, "utf8")).join("\n;\n")); | |
| } | |