node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


Metalsmith Imagemin version License

Metalsmith plugin to minify images.

Build Status Downloads Code Climate Coverage Status Dependency Status Dependencies


npm install --only=production --save metalsmith-imagemin


Pass options to the imagemin plugin and pass it to Metalsmith with the use method:

const Metalsmith = require('metalsmith')
const imagemin = require('metalsmith-imagemin');
const metalsmith = new Metalsmith(__dirname)
    optimizationLevel: 3,
    svgoPlugins: [{ removeViewBox: false }]


You can also use the plugin with the Metalsmith CLI by adding metalsmith-imagemin key to your metalsmith.json plugins with any imagemin options you want, like so:

  "plugins": {
    "metalsmith-imagemin": {
        "optimizationLevel": 3,
        "svgoPlugins": [{
          "removeViewBox": false

©️  ·  License: ISC  ·  Github: @ahmadnassri  ·  Twitter: @ahmadnassri