Hello! I'm trying to figure out how to access load context in my loader with the new Map api in getLoadContext.
export const serverBuildContext = createContext<ReturnType<typeof getBuild>>()
app.all(
'*',
createRequestHandler({
getLoadContext() {
const context = new RouterContextProvider()
context.set(serverBuildContext, getBuild())
return context
},
...
I can't import serverBuildContext in my route and vice versa because build fails with no import found, so not sure where to put router contexts to be able to access them from my app? I'm building sitemap.xml from my loader and it used to work with older api where I didn't need to depend on imports
export async function loader({request, context}: LoaderFunctionArgs) {
const serverBuild = await context.get(serverBuildContext)
any ideas? Thanks!