-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
76 lines (73 loc) · 2.37 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
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'
import ogPlugin from 'vite-plugin-open-graph'
import solidSvg from 'vite-plugin-solid-svg'
import solidPlugin from 'vite-plugin-solid'
import { defineConfig } from 'vite'
import { glob } from 'glob'
import { resolve } from 'path'
const pages = await glob('**/*.html', {
ignore: ['node_modules/**', 'dist/**'],
})
const entryPoint = Object.fromEntries(
pages.map((path) => [path, resolve(__dirname, path)])
)
export default defineConfig({
appType: 'mpa',
build: {
target: 'ESNext',
rollupOptions: {
input: entryPoint,
},
assetsInlineLimit: 0,
},
plugins: [
vanillaExtractPlugin({
unstable_mode: 'emitCss',
identifiers(props) {
return 'bk-' + (props.debugId?.toLowerCase() || props.hash)
},
}),
ogPlugin({
basic: {
title: 'Baking News: 꼭 너만을 위한 AI 뉴스레터',
url: 'https://baking-news.vercel.app',
image: '/image/og.png',
type: 'website',
description:
'꼭 너만을 위한 AI 뉴스레터, AI Newsletter only for you',
locale: 'ko_KR',
siteName: 'Baking News',
},
}),
solidPlugin(),
solidSvg({
svgo: {
enabled: true, // optional, by default is true
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// viewBox is required to resize SVGs with CSS.
// @see https://github.com/svg/svgo/issues/1128
// @see https://github.com/jfgodoy/vite-plugin-solid-svg/issues/26
removeViewBox: false,
},
},
},
],
},
},
}),
],
resolve: {
alias: {
'@shade': '/shade-ui',
'@components': '/components',
'@assets': '/assets',
'@utils': '/utils',
'@': __dirname,
},
},
})