-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
59 lines (57 loc) · 1.51 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import vue from '@vitejs/plugin-vue';
import { defineConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
import { fileURLToPath, URL } from 'url';
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
export default defineConfig({
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "@/assets/scss/main.scss" as *;`,
},
},
},
plugins: [
vue(),
legacy({
targets: ['defaults', 'not IE 11'],
}),
ViteImageOptimizer({
test: /\.(jpe?g|png|webp|svg|avif)$/i,
includePublic: true,
logStats: true,
ansiColors: true,
png: {
quality: 80,
},
jpeg: {
quality: 80,
},
jpg: {
quality: 80,
},
webp: {
quality: 80,
alphaQuality: 80,
force: false,
},
avif: {
quality: 80,
},
cache: false,
cacheLocation: undefined,
dynamicImport: true,
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@img': fileURLToPath(
new URL('./src/assets/images', import.meta.url)
),
'@fonts': fileURLToPath(
new URL('./public/fonts/', import.meta.url)
),
},
},
});