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

operation not permitted in beforeBundle false #111

Open
ErKeLost opened this issue Jan 23, 2024 · 0 comments
Open

operation not permitted in beforeBundle false #111

ErKeLost opened this issue Jan 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ErKeLost
Copy link
Member

ErKeLost commented Jan 23, 2024

Steps to reproduce

config repo

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import imagemin from 'unplugin-imagemin/vite';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
  // base: '/pathe/',
  resolve: {
    alias: {
      '~/': `${path.resolve(__dirname, 'src')}/`,
      '@/': `${path.resolve(__dirname, 'src')}/`,
    },
  },
  build: {
    // assetsInlineLimit: 4096 * 2,
  },
  plugins: [
    vue(),
    imagemin({
      // Default mode sharp. support squoosh and sharp
      mode: 'sharp',
      // cache: true,
      beforeBundle: false,
      // Default configuration options for compressing different pictures
      compress: {
        jpg: {
          quality: 10,
        },
        jpeg: {
          quality: 10,
        },
        png: {
          quality: 10,
        },
        webp: {
          quality: 10,
        },
      },
      conversion: [
        { from: 'jpeg', to: 'webp' },
        { from: 'jpg', to: 'webp' },
        { from: 'png', to: 'webp' },
      ],
    }),
  ],
});

What is expected?

normal

What is actually happening?

Compress error

System Info

win

Any additional comments?

No response

@ErKeLost ErKeLost added the bug Something isn't working label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant