Metalsmith wrapper for optipng
npm i metalsmith-optipng --save
const optipng = require('metalsmith-optipng')
Metalsmith(__dirname)
...
.use(optipng({
pattern: '**/*.png'
options: ['-o7']
})
...
- pattern is relative to your source and uses multimatch / glob to choose which files to apply to
- options are passed along to optipng