fix: Fix load configuration file error.

This commit is contained in:
jaywcjlove 2022-02-11 00:50:05 +08:00
parent 64677dd3a7
commit 2b7e99bc23
1 changed files with 2 additions and 4 deletions

View File

@ -165,10 +165,8 @@ export default async (options: SvgToFontOptions = {}) => {
const confPath = path.join(process.cwd(), '.svgtofontrc');
if (fs.pathExistsSync(confPath)) {
const pkg = require(confPath);
if (pkg.svgtofont) {
options = { ...options, ...pkg.svgtofont }
}
const conf = await fs.readJson(confPath);
options = { ...options, ...conf };
}
options.dist = options.dist || path.join(process.cwd(), 'fonts');