Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

loadConfigFile.ts

8 lines250 Bytes

1import { pathToFileURL } from 'node:url'
2import { tsImport } from 'tsx/esm/api'
3​
4export async function loadConfigFile(filePath: string) {
5 const fileURL = pathToFileURL(filePath).href
6 const loaded = await tsImport(fileURL, './')
7 return loaded
8}