Possibly just auto-run the npm run optimize script on a precommit hook using husky or something. Then we never have to worry about manually running the script in the future (since it's really hard for me to tell if an image in a PR has been pre-optimized or not).
Conversely, we could be lazy and maybe find some other apropo hook, like preversion or prepublish or something. Then it will just automatically optimize right before we push a new version to npm; which may be good enough(tm).
Not sure if this would work, but I saw this on @chuckharmston's beautiful mozilla/testpilot-ga repo:
https://github.com/okonet/lint-staged
Possibly just auto-run the
npm run optimize
script on a precommit hook using husky or something. Then we never have to worry about manually running the script in the future (since it's really hard for me to tell if an image in a PR has been pre-optimized or not).Conversely, we could be lazy and maybe find some other apropo hook, like
preversion
orprepublish
or something. Then it will just automatically optimize right before we push a new version to npm; which may be good enough(tm).