-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
71 lines (66 loc) · 1.72 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import path from 'node:path';
import UnpluginTypia from '@ryoppippi/unplugin-typia/vite';
import { cloudflareRedirect } from '@ryoppippi/vite-plugin-cloudflare-redirect';
import { enhancedImages } from '@sveltejs/enhanced-img';
import { sveltekit } from '@sveltejs/kit/vite';
import extractorSvelte from '@unocss/extractor-svelte';
import Macros from '@unplugin/macros/vite';
// @ts-expect-error no type
import autoImport from 'sveltekit-autoimport';
import UnoCSS from 'unocss/vite';
import Icons from 'unplugin-icons/vite';
import Components from 'unplugin-svelte-components/vite';
import { defineConfig } from 'vite';
import { faviconsPlugin } from 'vite-plugin-favicons';
import { Route } from './routes.js';
function relativePath(...args: string[]): string {
return path.resolve(import.meta.dirname, ...args);
}
export default defineConfig({
esbuild: {
target: 'es2022',
},
plugins: [
/* favicon と metadata の設定 */
faviconsPlugin({
cache: true,
imgSrc: relativePath('./static/ryoppippi.jpg'),
/* ===== metadataの設定 ===== */
path: `/favicons`,
lang: 'ja-JP',
orientation: 'portrait',
}),
cloudflareRedirect({
mode: 'generate',
entries: Route,
}),
UnpluginTypia({ log: 'verbose', cache: true }),
Icons({ compiler: 'svelte' }),
enhancedImages(),
Macros(),
UnoCSS({
extractors: [
extractorSvelte(),
],
}),
Components({
dirs: ['src/components'],
dts: './src/components.d.ts',
}),
// eslint-disable-next-line ts/no-unsafe-call
autoImport({
include: ['**/*.(svelte|md)'],
components: ['./src/components'],
module: {
'sveltweet': [
'Tweet',
'TweetNotFound',
],
'sveltekit-embed': [
'YouTube',
],
},
}),
sveltekit(),
],
});