UNPKG

vike

Version:

The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.

16 lines (15 loc) 641 B
import './assertEnvApi.js'; export { prepareViteApiCall }; import { clearContextVikeApiOperation, setContextVikeApiOperation } from '../../shared-server-node/api-context.js'; import { clearGlobalContext } from '../../server/runtime/globalContext.js'; import { resolveViteConfigFromUser } from './resolveViteConfigFromUser.js'; async function prepareViteApiCall(options, operation) { clear(); setContextVikeApiOperation(operation, options); return resolveViteConfigFromUser(); } // For subsequent API calls, e.g. calling prerender() after build() function clear() { clearContextVikeApiOperation(); clearGlobalContext(); }