Skip to content

Commit b87ba6b

Browse files
committed
chore: add uuid fn
1 parent 4e43a68 commit b87ba6b

File tree

7 files changed

+58
-10
lines changed

7 files changed

+58
-10
lines changed

.github/svgo.config.js

-9
This file was deleted.

.github/workflows/svgo.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '14'
15+
- run: yarn install
1216
- uses: ericcornelissen/[email protected]
1317
with:
1418
repo-token: ${{ secrets.GITHUB_TOKEN }}
15-
svgo-options: ".github/svgo.config.js"
19+
svgo-options: "./svgo.config.js"
1620
comment: true
1721
svgo-version: 2

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"stylelint-config-recommended-scss": "^4.2.0",
106106
"stylelint-scss": "^3.18.0",
107107
"svgo": "^2.3.0",
108+
"uuid": "^8.3.2",
108109
"webpack": "^4.43.0"
109110
}
110111
}

svgo.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const { v4: uuid } = require('uuid');
2+
3+
module.exports = {
4+
plugins: [
5+
{
6+
name: 'prefixIds',
7+
params: {
8+
prefix: () => {
9+
return uuid();
10+
},
11+
},
12+
},
13+
{
14+
name: 'cleanupIDs',
15+
active: false,
16+
},
17+
],
18+
};

test-out.svg

+1
Loading

test.svg

+28
Loading

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -17398,6 +17398,11 @@ [email protected], uuid@^3.0.0, uuid@^3.0.1, uuid@^3.3.2, uuid@^3.4.0:
1739817398
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
1739917399
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
1740017400

17401+
uuid@^8.3.2:
17402+
version "8.3.2"
17403+
resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
17404+
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
17405+
1740117406
v8-compile-cache@^2.0.3, v8-compile-cache@^2.1.1:
1740217407
version "2.1.1"
1740317408
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745"

0 commit comments

Comments
 (0)