vben
authored
|
1
|
// Image resource files used to compress the output of the production environment
|
vben
authored
|
2
|
// https://github.com/anncwb/vite-plugin-imagemin
|
vben
authored
|
3
4
5
6
7
8
9
10
11
12
13
14
|
import viteImagemin from 'vite-plugin-imagemin';
export function configImageminPlugin() {
const plugin = viteImagemin({
gifsicle: {
optimizationLevel: 7,
interlaced: false,
},
optipng: {
optimizationLevel: 7,
},
mozjpeg: {
|
Vben
authored
|
15
|
quality: 20,
|
vben
authored
|
16
17
|
},
pngquant: {
|
Vben
authored
|
18
|
quality: [0.8, 0.9],
|
vben
authored
|
19
20
21
22
23
|
speed: 4,
},
svgo: {
plugins: [
{
|
Vben
authored
|
24
|
name: 'removeViewBox',
|
vben
authored
|
25
26
|
},
{
|
Vben
authored
|
27
28
|
name: 'removeEmptyAttrs',
active: false,
|
vben
authored
|
29
30
31
32
33
34
|
},
],
},
});
return plugin;
}
|