diff --git a/.changeset/smart-owls-beam.md b/.changeset/smart-owls-beam.md new file mode 100644 index 0000000000..e01640e186 --- /dev/null +++ b/.changeset/smart-owls-beam.md @@ -0,0 +1,5 @@ +--- +'@td-design/svgicon-cli': patch +--- + +修复另一处 glob 使用的报错 diff --git a/packages/svgicon-cli/src/libs/generateComponent.ts b/packages/svgicon-cli/src/libs/generateComponent.ts index cc306cd819..bbac5e289d 100644 --- a/packages/svgicon-cli/src/libs/generateComponent.ts +++ b/packages/svgicon-cli/src/libs/generateComponent.ts @@ -1,6 +1,6 @@ import colors from 'colors'; import fs from 'fs'; -import glob from 'glob'; +import { globSync } from 'glob'; import { camelCase, upperFirst } from 'lodash'; import mkdirp from 'mkdirp'; import path from 'path'; @@ -35,7 +35,7 @@ export const generateComponent = (localSvg: ILocalSvg[], config: Config) => { let cases = ''; mkdirp.sync(saveDir); - glob.sync(path.join(saveDir, '*')).forEach(file => fs.unlinkSync(file)); + globSync(path.join(saveDir, '*')).forEach(file => fs.unlinkSync(file)); svgComponents.add('GProps'); copyTemplate(`helper${jsExtension}`, path.join(saveDir, `helper${jsExtension}`));