import { logger } from "onefx/lib/integrated-gateways/logger" ; import { Context } from "onefx/lib/types" ; import koa from "koa" ; export function manifestMiddleware ( ) { return async ( ctx , next ) : Promise < void > => { let manifest = { } ; try { manifest = require ( "../../../dist/asset-manifest.json" ) ; } catch ( e ) { logger . info ( `cannot load manifest: ${ e . stack }` ) ; } ctx . setState ( "base.manifest" , manifest ) ; await next ( ) ; } ; }