Download scripts/realtime-preload.cjs from helo-ayush/NewIntentExtractor: direct link, hf CLI and curl.
- Browser
- Download file 595 Bytes
-
https://huggingface.co/spaces/helo-ayush/NewIntentExtractor/resolve/main/scripts/realtime-preload.cjs
- Command line
-
hf download hf://spaces/helo-ayush/NewIntentExtractor/scripts/realtime-preload.cjs
-
curl -L -o realtime-preload.cjs https://huggingface.co/spaces/helo-ayush/NewIntentExtractor/resolve/main/scripts/realtime-preload.cjs
595 Bytes
| // `tsx` compiles the app DAL through CommonJS, so the ESM resolver hook cannot | |
| // intercept its `require("server-only")`. Install the same harmless alias Next's | |
| // server compiler uses before the DAL is loaded. | |
| // eslint-disable-next-line @typescript-eslint/no-require-imports | |
| const Module = require("node:module"); | |
| const originalResolve = Module._resolveFilename; | |
| Module._resolveFilename = function (request, parent, isMain, options) { | |
| if (request === "server-only") request = "next/dist/compiled/server-only/empty"; | |
| return originalResolve.call(this, request, parent, isMain, options); | |
| }; | |