Skip to content

Commit

Permalink
fix: fix import cheerio issue. #236
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 12, 2024
1 parent a1e94fb commit 7f5bef1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs, { ReadStream } from 'fs-extra';
import path from 'path';
import ejs from 'ejs';
import color from 'colors-cli';
import cheerio from 'cheerio';
import { load } from 'cheerio';
import svg2ttf from 'svg2ttf';
import ttf2eot from 'ttf2eot';
import ttf2woff from 'ttf2woff';
Expand Down Expand Up @@ -227,7 +227,7 @@ export function createWOFF2(options: SvgToFontOptions = {}, ttf: Buffer) {
*/
export function createSvgSymbol(options: SvgToFontOptions = {}) {
const DIST_PATH = path.join(options.dist, `${options.fontName}.symbol.svg`);
const $ = cheerio.load('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0" style="display:none;"></svg>');
const $ = load('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0" style="display:none;"></svg>');
return new Promise((resolve, reject) => {
filterSvgFiles(options.src).forEach(svgPath => {
const fileName = path.basename(svgPath, path.extname(svgPath));
Expand Down

0 comments on commit 7f5bef1

Please sign in to comment.