Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagemin config ignored #45

Open
kahlan88 opened this issue Aug 7, 2023 · 0 comments
Open

imagemin config ignored #45

kahlan88 opened this issue Aug 7, 2023 · 0 comments

Comments

@kahlan88
Copy link

kahlan88 commented Aug 7, 2023

I checked this issue #1.
I tried the config settings provided in the readme of this project and js config as per Vite docs:

import viteImagemin from "vite-plugin-imagemin";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [
    viteImagemin({
      gifsicle: {
        optimizationLevel: 7,
        interlaced: false,
      },
      optipng: {
        optimizationLevel: 7,
      },
      mozjpeg: {
        quality: 20,
      },
      pngquant: {
        quality: [0.8, 0.9],
        speed: 4,
      },
      svgo: {
        plugins: [
          {
            name: "removeViewBox",
          },
          {
            name: "removeEmptyAttrs",
            active: false,
          },
        ],
      },
    }),
  ],
});
node: 16.16.0
vite: ^4.4.5
vite-plugin-imagemin: ^0.6.1

I tried disabling webp, but it didn't make a difference in my case.
I'm using latest version of vite and vite-plugin-imagemin.

I get no errors, and no compression on my production build:
example images from build

Any ideas? Have I missed something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant