MCPcopy
hub / github.com/redwoodjs/graphql / parseConfigFile

Function parseConfigFile

packages/babel-config/src/common.ts:111–123  ·  view source on GitHub ↗
(basePath: string)

Source from the content-addressed store, hash-verified

109 const rwPaths = getPaths()
110
111 const parseConfigFile = (basePath: string) => {
112 let configPath = path.join(basePath, 'tsconfig.json')
113 if (!fs.existsSync(configPath)) {
114 configPath = path.join(basePath, 'jsconfig.json')
115 if (!fs.existsSync(configPath)) {
116 return null
117 }
118 }
119 return parseConfigFileTextToJson(
120 configPath,
121 fs.readFileSync(configPath, 'utf-8'),
122 )
123 }
124 const apiConfig = parseConfigFile(rwPaths.api.base)
125 const webConfig = parseConfigFile(rwPaths.web.base)
126

Callers 1

Calls 2

existsSyncMethod · 0.65
readFileSyncMethod · 0.65

Tested by

no test coverage detected