From 4cf70ee4287f74d4825dfea0964fad0afd2f4429 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Fri, 11 Feb 2022 02:24:33 +0800 Subject: [PATCH] fix: Fix website version option issue. --- src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index b42af93f..5822afec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -155,6 +155,12 @@ export type SvgToFontOptions = { } export default async (options: SvgToFontOptions = {}) => { + const confPath = path.join(process.cwd(), '.svgtofontrc'); + if (fs.pathExistsSync(confPath)) { + const conf = await fs.readJson(confPath); + options = { ...options, ...conf }; + } + const pkgPath = path.join(process.cwd(), 'package.json'); if (fs.pathExistsSync(pkgPath)) { const pkg = require(pkgPath); @@ -166,12 +172,6 @@ export default async (options: SvgToFontOptions = {}) => { } } - const confPath = path.join(process.cwd(), '.svgtofontrc'); - if (fs.pathExistsSync(confPath)) { - const conf = await fs.readJson(confPath); - options = { ...options, ...conf }; - } - options.dist = options.dist || path.join(process.cwd(), 'fonts'); options.src = options.src || path.join(process.cwd(), 'svg'); options.startUnicode = options.startUnicode || 0xea01;