2023-01-22 00:13:42 +00:00
|
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
|
|
|
import type { UserConfig } from 'vite';
|
2023-04-09 20:44:45 +00:00
|
|
|
import { imagetools } from '@zerodevx/svelte-img/vite';
|
|
|
|
|
// import { imagetools } from 'vite-imagetools';
|
2023-01-22 00:13:42 +00:00
|
|
|
|
|
|
|
|
const config: UserConfig = {
|
2023-04-09 20:44:45 +00:00
|
|
|
plugins: [
|
|
|
|
|
sveltekit(),
|
|
|
|
|
imagetools({
|
|
|
|
|
// By default, directives are `?width=480;1024;1920&format=avif;webp;jpg`
|
|
|
|
|
// Now we change it to generate 5 variants instead - `avif/jpg` formats at `640/1280` + LQIP
|
|
|
|
|
defaultDirectives: () =>
|
2023-04-11 00:38:17 +00:00
|
|
|
new URLSearchParams('?width=320;480;640;1024;1920&format=avif;webp;jpg&lqip=64')
|
2023-04-09 20:44:45 +00:00
|
|
|
})
|
|
|
|
|
],
|
2023-01-22 00:13:42 +00:00
|
|
|
test: {
|
|
|
|
|
include: ['src/**/*.{test,spec}.{js,ts}']
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default config;
|