Skip to content

Commit

Permalink
Add svgo as npm dependency and setup npm script to run it
Browse files Browse the repository at this point in the history
  • Loading branch information
waldyrious committed Jun 9, 2023
1 parent 3558505 commit 09fe332
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Don't track the Node.js installation artifacts
/node_modules/
/package-lock.json
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@ npm install --save https://github.com/HatScripts/circle-flags
## Contributing

To contribute, you need to have the latest version of [svgo](https://github.com/svg/svgo) installed.
You can run the following command to install it in the circle-flags project directory:

```sh
npm install
```

First, edit the relevant SVG files in the `flags/` directory.

Then run `svgo` to optimize the SVG files:
Then run the `svgo` wrapper script (defined in the scripts section of [package.json](./package.json)),
which uses the locally-installed `svgo` executable to optimize the SVG files:

```sh
svgo ./flags --recursive --config=svgo.config.js
npm run svgo
```

Then commit the changes, and submit them as a pull request.
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@
"bugs": {
"url": "https://github.com/HatScripts/circle-flags/issues"
},
"homepage": "https://github.com/HatScripts/circle-flags#readme"
"homepage": "https://github.com/HatScripts/circle-flags#readme",
"devDependencies": {
"svgo": "^3.0.2"
},
"scripts": {
"svgo": "node_modules/.bin/svgo ./flags --recursive --config=svgo.config.js"
}
}

0 comments on commit 09fe332

Please sign in to comment.