fsでconfigを読み込み

This commit is contained in:
takejohn 2024-04-03 22:41:38 +09:00
parent 3f710c7c6b
commit 5b2bcdda3c

View file

@ -18,9 +18,11 @@ type Config = {
}; };
import chalk from 'chalk'; import chalk from 'chalk';
import uncheckedConfig from '../config.json' assert { type: 'json' }; import fs from "fs";
import { warn } from '@/utils/log.js'; import { warn } from '@/utils/log.js';
const uncheckedConfig = JSON.parse(fs.readFileSync('./config.json', 'utf8'));
function warnWithPrefix(msg: string): void { function warnWithPrefix(msg: string): void {
warn(`[Config]: ${chalk.red(msg)}`); warn(`[Config]: ${chalk.red(msg)}`);
} }