Skip to content

Commit

Permalink
feat: enhanced options.css config. (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 13, 2023
1 parent 5c514f1 commit d957f8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ export default async (options: SvgToFontOptions = {}) => {
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
1 change: 1 addition & 0 deletions test/example/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
/** @type {(option: import('../../').SvgToFontOptions) => void} */
const svgtofont = require("../../lib");
const pkg = require('../../package.json');

Expand Down

0 comments on commit d957f8f

Please sign in to comment.