diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fcbbc8d800f3..aa3f02f37251 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -103,6 +103,7 @@ jobs: - run: make jsdoc - run: npm run build-api - run: npm run dist + - run: npm run dist-spinner - uses: actions/upload-artifact@v2 with: diff --git a/package.json b/package.json index b89704b64585..769987a83e83 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "serve-gmf-apps": "DEV_SERVER=1 TARGET=gmf-apps webpack-dev-server --https --cert=private.crt --key=private.key --port=3000 --mode=development --progress --debug", "serve-api": "webpack-dev-server --content-base=api/dist/apihelp/ --config=buildtools/webpack.api.js --https --cert=private.crt --key=private.key --port=3000 --mode=development --progress --watch --debug", "dist": "TARGET=dist webpack --mode=production --progress --debug", + "dist-spinner": "svgo --config=svgo.js contribs/gmf/src/icons/spinner.svg --output=dist/spinner.svg", "build-gmf-apps-profile": "TARGET=gmf-apps webpack --profile --json > profile.json", "typecheck": "tsc --noEmit", "doc": "typedoc", diff --git a/svgo.js b/svgo.js new file mode 100644 index 000000000000..c99ba82eefab --- /dev/null +++ b/svgo.js @@ -0,0 +1,35 @@ +// The MIT License (MIT) +// +// Copyright (c) 2021 Camptocamp SA +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = { + js2svg: { + pretty: true, + }, + plugins: [ + 'preset-default', + { + name: 'removeAttrs', + params: { + attrs: '(style)', + }, + }, + ], +};