2024-09-10 11:57:09 +02:00
|
|
|
import fs from "fs";
|
|
|
|
|
import path from "path";
|
2024-09-10 10:04:43 +02:00
|
|
|
import defaultConfig, { Config } from "./default-config";
|
|
|
|
|
|
2024-09-10 11:57:09 +02:00
|
|
|
const customConfigPath = path.resolve(process.cwd(), "custom-config.js");
|
|
|
|
|
|
|
|
|
|
let customConfig: Partial<Config> = {};
|
|
|
|
|
|
|
|
|
|
if (fs.existsSync(customConfigPath)) {
|
|
|
|
|
import(customConfigPath)
|
|
|
|
|
.then((module) => {
|
|
|
|
|
customConfig = module.default;
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
2024-09-10 15:16:27 +02:00
|
|
|
console.warn("Could not find custom configuration:", error);
|
2024-09-10 11:57:09 +02:00
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
console.info("No custom configuration file found!");
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-10 10:04:43 +02:00
|
|
|
const config: Config = {
|
|
|
|
|
...defaultConfig,
|
|
|
|
|
...customConfig,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default config;
|