Skip to content

Commit

Permalink
fix: fix css option error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 8, 2023
1 parent e6cdc20 commit b676a8a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ export default async (options: SvgToFontOptions = {}) => {
const pkgPath = path.join(process.cwd(), 'package.json');
if (fs.pathExistsSync(pkgPath)) {
const pkg = require(pkgPath);
if (pkg.svgtofont) {
const cssOptions = options.css
options = { ...options, ...pkg.svgtofont }
if (pkg.svgtofont.css && cssOptions && typeof cssOptions === 'object') {
options.css = { ...cssOptions, ...pkg.svgtofont.css }
}
}
if (options.website && pkg.version) {
options.website.version = pkg.version;
}
Expand Down

0 comments on commit b676a8a

Please sign in to comment.