hatch-surf/node_modules/next/dist/esm/build/templates/edge-wrapper.js
Riley Zhang df378d33ef
Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Merge GitHub main into Gitea repo (allow unrelated histories)
Resolved conflicts by taking GitHub versions for:
- .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml

Kept deploy.sh updated to:
- Pull from GitHub (primary source)
- Push to Gitea (push-mirror)
- Build from site/ directory (GitHub structure)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-25 05:20:46 +02:00

23 lines
1.1 KiB
JavaScript

// The wrapped module could be an async module, we handle that with the proxy
// here. The comma expression makes sure we don't call the function with the
// module as the "this" arg.
// Turn exports into functions that are also a thenable. This way you can await the whole object
// or exports (e.g. for Components) or call them directly as though they are async functions
// (e.g. edge functions/middleware, this is what the Edge Runtime does).
// Catch promise to prevent UnhandledPromiseRejectionWarning, this will be propagated through
// the awaited export(s) anyway.
self._ENTRIES ||= {};
const modProm = import('MODULE');
modProm.catch(()=>{});
self._ENTRIES['VAR_ENTRY_NAME'] = new Proxy(modProm, {
get (innerModProm, name) {
if (name === 'then') {
return (res, rej)=>innerModProm.then(res, rej);
}
let result = (...args)=>innerModProm.then((mod)=>(0, mod[name])(...args));
result.then = (res, rej)=>innerModProm.then((mod)=>mod[name]).then(res, rej);
return result;
}
});
//# sourceMappingURL=edge-wrapper.js.map