You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

nuxt-imagemin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-imagemin

Nuxt plugin to minify your images

1.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

nuxt-imagemin

wemake.services Build Status

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

Installation

npm install --save nuxt-imagemin

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

{
  modules: [
    'nuxt-imagemin',
  ]
}

Usage

  • Put your images inside assets folder, for example: logo.png
  • Then create an element to render it: <img src="~/assets/logo.png">
  • 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.

Keywords

nuxt

FAQs

Package last updated on 08 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts