-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
77 lines (74 loc) Β· 1.8 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
72
73
74
75
76
77
import { defineConfig, HtmlTagDescriptor } from 'vite';
import { createHtmlPlugin } from 'vite-plugin-html';
const metaDatas = [
// OG
{
property: 'og:type',
content: 'website',
},
{
property: 'og:image',
content: '/images/og.png',
},
{
property: 'og:title',
content: 'νλ‘ νΈμλμμ ν¨μνμ μΆκ΅¬νλ©΄ μλλ κ±ΈκΉ?',
},
{
property: 'og:description',
content: 'ν¨μν νλ‘κ·Έλλ°μ λν μ΄λ‘ κ³Ό νλ‘ νΈμλ κ°λ°μ νλ©΄μ ν¨μν νλ‘κ·Έλλ°μ μ μ©ν μ¬λ‘λ₯Ό μκ°ν©λλ€.',
},
{
property: 'og:locale',
content: 'ko_KR',
},
{
property: 'og:site_name',
content: 'νλ‘ νΈμλμμ ν¨μνμ μΆκ΅¬νλ©΄ μλλ κ±ΈκΉ?',
},
{
property: 'og:image:width',
content: '1200',
},
{
property: 'og:image:height',
content: '600',
},
// Twitter
{
property: 'twitter:card',
content: 'summary',
},
{
property: 'twitter:title',
content: 'νλ‘ νΈμλμμ ν¨μνμ μΆκ΅¬νλ©΄ μλλ κ±ΈκΉ?',
},
{
property: 'twitter:description',
content: 'ν¨μν νλ‘κ·Έλλ°μ λν μ΄λ‘ κ³Ό νλ‘ νΈμλ κ°λ°μ νλ©΄μ ν¨μν νλ‘κ·Έλλ°μ μ μ©ν μ¬λ‘λ₯Ό μκ°ν©λλ€.',
},
{
property: 'twitter:image',
content: '/images/og.png',
},
// ETC
{
property: 'keywords',
content: 'TypeScript, JavaScript, ReactJS, React, Functional Programming, FP, JSConf, JSConf 2022',
},
];
const generateMetaTag = (meta: typeof metaDatas[number]): HtmlTagDescriptor => ({
injectTo: 'head-prepend',
tag: 'meta',
attrs: { ...meta },
});
export default defineConfig({
plugins: [
createHtmlPlugin({
minify: true,
inject: {
tags: metaDatas.map(generateMetaTag),
},
}),
],
})