Add hook to optimize staged SVGs before commit (#166)

This commit is contained in:
Christopher Sandvik
2021-01-14 16:33:17 -05:00
committed by GitHub
parent 4352e985df
commit 3bedf3ba36
3 changed files with 319 additions and 5 deletions

View File

@@ -0,0 +1,10 @@
import fs from 'fs';
import processSvg from './render/processSvg';
const svgFiles = process.argv.slice(4);
svgFiles.forEach(async svgFile => {
const content = fs.readFileSync(svgFile);
const svg = await processSvg(content);
fs.writeFileSync(svgFile, svg, 'utf-8');
});