import * as fs from "fs" ; import * as path from "path" ; import "@itwin/oidc-signin-tool/lib/cjs/certa/certaBackend" ; import { exposeBackendCallbacks } from "../common/SideChannels" ; /** Loads the provided `.env` file into process.env */ function loadEnv ( envFile ) { if ( ! fs . existsSync ( envFile ) ) return ; const dotenv = require ( "dotenv" ) ; const dotenvExpand = require ( "dotenv-expand" ) ; const envResult = dotenv . config ( { path : envFile } ) ; if ( envResult . error ) { throw envResult . error ; } dotenvExpand ( envResult ) ; } module . exports = ( async ( ) => { loadEnv ( path . join ( __dirname , ".." , ".." , ".env" ) ) ; exposeBackendCallbacks ( ) ; } ) ( ) ;