(assetName)
| 24 | ]); |
| 25 | |
| 26 | async function optimizeSvgFile(assetName) { |
| 27 | const sourceFile = path.join(sourceDir, assetName); |
| 28 | const svg = await fs.readFile(sourceFile); |
| 29 | const resultPass1 = optimize(svg, { |
| 30 | multipass: true, |
| 31 | plugins: configPluginsFirstPass |
| 32 | }); |
| 33 | if (resultPass1.error) { |
| 34 | throw new Error(resultPass1.error); |
| 35 | } |
| 36 | |
| 37 | await fs.writeFile(path.join(targetDemoDir, assetName), resultPass1.data); |
| 38 | await fs.writeFile(path.join(targetWebsiteDir, assetName), resultPass1.data); |
| 39 | } |
| 40 | |
| 41 | async function run() { |
| 42 | const assets = await fs.readdir(sourceDir); |
no outgoing calls
no test coverage detected
searching dependent graphs…