alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
26 lines (24 loc) • 582 B
JavaScript
import "../../chunks/chunk-U5RRZUYZ.js";
// src/cli/util/FindConfigFile.ts
import fs from "node:fs";
import path from "node:path";
var defaultLocations = [
"alinea.config",
"src/alinea.config",
"cms",
"src/cms"
];
var testExtensions = [".ts", ".tsx", ".js", ".jsx"];
function findConfigFile(cwd) {
for (const location of defaultLocations) {
for (const extension of testExtensions) {
const testLocation = path.join(cwd, location + extension);
if (fs.existsSync(testLocation)) {
return testLocation;
}
}
}
}
export {
findConfigFile
};