Modernize SVGO setup (#8149)

* SVGO now discovers config file automatically

* Drop `svgo` script from package.json

* Use '.mjs' extension for SVGO config file
This commit is contained in:
Álvaro Mondéjar 2022-12-21 12:56:09 +01:00 committed by GitHub
parent 119fdd812b
commit 3271d9e950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -144,9 +144,7 @@ If you have any problems or questions while creating the SVG, check out [the Git
All icons in Simple Icons have been optimized with the [SVGO tool](https://github.com/svg/svgo). This can be done in one of three ways: All icons in Simple Icons have been optimized with the [SVGO tool](https://github.com/svg/svgo). This can be done in one of three ways:
* The [SVGO Command Line Tool](https://github.com/svg/svgo) * The [SVGO Command Line Tool](https://github.com/svg/svgo)
* Install dependencies * Run the following command `npx svgo icons/file-to-optimize.svg`
* With npm: `npm install` from the root of this repository
* Run the following command `npm run svgo -- icons/file-to-optimize.svg`
* Check if there is a loss of quality in the output, if so increase the precision. * Check if there is a loss of quality in the output, if so increase the precision.
* The [SVGOMG Online Tool](https://jakearchibald.github.io/svgomg/) * The [SVGOMG Online Tool](https://jakearchibald.github.io/svgomg/)
* Click "Open SVG" and select an SVG file. * Click "Open SVG" and select an SVG file.

View File

@ -73,7 +73,6 @@
"test": "mocha tests --reporter tests/min-reporter.cjs --inline-diffs", "test": "mocha tests --reporter tests/min-reporter.cjs --inline-diffs",
"pretest": "npm run prepublishOnly", "pretest": "npm run prepublishOnly",
"posttest": "npm run postpublish", "posttest": "npm run postpublish",
"svgo": "svgo --config svgo.config.js",
"get-filename": "node scripts/get-filename.js", "get-filename": "node scripts/get-filename.js",
"add-icon-data": "node scripts/add-icon-data.js" "add-icon-data": "node scripts/add-icon-data.js"
}, },

View File

@ -1,4 +1,4 @@
module.exports = { export default {
multipass: true, multipass: true,
eol: 'lf', eol: 'lf',
plugins: [ plugins: [