Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG-3769: Optimize image assets #4635

Merged
merged 5 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ jobs:
bundle exec rubocop
make lint_erb
make check_asset_strings
make lint_optimized_assets
NODE_ENV=production ./bin/webpack && yarn es5-safe
build-release-container:
working_directory: ~/identity-idp
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ normalize_yaml:
i18n-tasks normalize
find ./config/locales -type f | xargs ./scripts/normalize-yaml config/country_dialing_codes.yml

optimize_svg:
# Without disabling minifyStyles, keyframes are removed (e.g. `app/assets/images/id-card.svg`).
# See: https://github.com/svg/svgo/issues/888
find app/assets/images public -name '*.svg' | xargs ./node_modules/.bin/svgo --multipass --disable minifyStyles --config '{"plugins":[{"removeAttrs":{"attrs":"data-name"}}]}'

optimize_assets: optimize_svg

lint_optimized_assets: optimize_assets
git diff --quiet || (echo "Error: Optimize assets using 'make optimize_assets'"; exit 1)

update_country_dialing_codes:
bundle exec ./scripts/pinpoint-supported-countries > config/country_dialing_codes.yml

Expand Down
2 changes: 1 addition & 1 deletion app/assets/images/2FA-voice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/images/alert/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/images/alert/fail-lg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/images/alert/fail-x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading