imagemin-lint-staged: in-place minify the images before adding to the git repo
Published in
1 min readNov 14, 2017
imagemin-lint-staged is a tool designed to be used with lint-staged, which giving you:
- in-place minify the images before adding to the git repo
- with minified images, you can remove minify step in your bundler config (webpack, gulp, Grunt……)
bundleTime--
,buildSpeed++
Try it now! First,
npm install --save-dev lint-staged imagemin-lint-staged
Then, add this to your package.json
:
"lint-staged": {
"*.{png,jpeg,jpg,gif,svg}": ["imagemin-lint-staged", "git add"]
},
All done.