-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
51 lines (49 loc) · 1.21 KB
/
vite.config.ts
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
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
import { imagetools } from 'vite-imagetools';
import svg from '@poppanator/sveltekit-svg';
const config: UserConfig = {
plugins: [
sveltekit(),
imagetools(),
svg({
includePaths: ['./src/lib/icons/'],
svgoOptions: {
multipass: true,
plugins: [
{
name: 'preset-default',
// by default svgo removes the viewBox which prevents svg icons from scaling
// not a good idea! https://github.com/svg/svgo/pull/1461
params: {
overrides: {
removeViewBox: false
}
}
},
{ name: 'removeAttrs', params: { attrs: '(fill|stroke)' } },
'removeDimensions'
]
}
}),
svg({
includePaths: ['./src/lib/images'],
svgoOptions: {
multipass: true,
plugins: [
{
name: 'preset-default',
// by default svgo removes the viewBox which prevents svg icons from scaling
// not a good idea! https://github.com/svg/svgo/pull/1461
params: { overrides: { removeViewBox: false, removeTitle: false } }
}
]
}
})
]
// @TODO: Why is this erroring?
// test: {
// include: ['src/**/*.{test,spec}.{js,ts}']
// }
};
export default config;