Skip to content

Nuxt module to minify your images. Works with: png, jpeg, gif, and svg

License

Notifications You must be signed in to change notification settings

alexguevara/nuxt-imagemin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nuxt-imagemin

wemake.services Build Status

Nuxt module to minify your images. Works with: png, jpeg, gif, and svg.

Installation

npm install --save-dev nuxt-imagemin

Add nuxt-imagemin to your nuxt.config.js:

{
  modules: ["nuxt-imagemin"];
}

Usage

  1. Put your images inside assets folder, for example: logo.png
  2. Then create an element to render it: <img src="~/assets/logo.png">
  3. When you will bundle your app for production, nuxt will minify your image assets

Read more about how assets work.

Options

We use imagemin plugin for webpack internally. It has a lot of options. We pass any provided options into the imagemin itself:

{
  modules: [
    [
      "nuxt-imagemin",
      {
        optipng: { optimizationLevel: 5 },
        gifsicle: { optimizationLevel: 2 }
      }
    ]
  ];
}

License

MIT.

About

Nuxt module to minify your images. Works with: png, jpeg, gif, and svg

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%