Skip to content

Commit

Permalink
🐛 await optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangWeixian committed Sep 6, 2023
1 parent 0ccf4c0 commit 4158b0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/giant-items-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svgr-rs/svgrs-plugin": patch
---

await optimize
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const svgo = async (code: string, config: Config, state: State) => {
svgoInstance = await import('svgo')
}
const svgoConfig = getSvgoConfig(config)
const result = svgoInstance.optimize(code, { ...svgoConfig, path: state.filePath })
const result = await svgoInstance.optimize(code, { ...svgoConfig, path: state.filePath })

// @ts-expect-error -- ignore
if (result.modernError) {
Expand Down

0 comments on commit 4158b0b

Please sign in to comment.