-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
72 lines (71 loc) · 1.54 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
60
61
62
63
64
65
66
67
68
69
70
71
72
import Inspect from 'vite-plugin-inspect';
import { resolve } from 'path';
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
import autoprefixer from 'autoprefixer';
import tsconfigPaths from 'vite-tsconfig-paths';
import checker from 'vite-plugin-checker';
export default {
publicDir: 'assets',
plugins: [
Inspect(),
ViteImageOptimizer({
svg: {
multipass: true,
plugins: [
{
name: 'preset-default',
params: {
overrides: {
cleanupNumericValues: false,
removeViewBox: false, // https://github.com/svg/svgo/issues/1128
},
cleanupIDs: {
minify: false,
remove: false,
},
convertPathData: false,
},
},
'sortAttrs',
{
name: 'addAttributesToSVGElement',
params: {
attributes: [{ xmlns: 'http://www.w3.org/2000/svg' }],
},
},
],
},
png: {
quality: 85,
},
jpg: {
quality: 85,
},
webp: {
quality: 70,
},
}),
tsconfigPaths(),
checker({
typescript: true,
}),
],
base: './',
root: 'src',
build: {
outDir: '../dist',
rollupOptions: {
input: {
main: resolve(__dirname, './src/index.html'),
},
},
minify: false,
compact: false,
sourcemap: true,
},
css: {
postcss: {
plugins: [autoprefixer()],
},
},
};