complai/frontend/vite.config.ts
2023-01-14 15:20:17 +01:00

33 lines
782 B
TypeScript

import { sveltekit } from '@sveltejs/kit/vite';
import svg from '@poppanator/sveltekit-svg';
import type { UserConfig } from 'vite';
import autoprefixer from 'autoprefixer';
const config: UserConfig = {
plugins: [
sveltekit(),
svg({
includePaths: ['./src/lib/icons/', './src/assets/icons/'],
svgoOptions: {
multipass: false,
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|stroke-width)' } }
]
}
})
],
css: {
postcss: {
plugins: [autoprefixer]
}
}
};
export default config;