-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (38 loc) · 1.04 KB
/
Copy pathvite.config.ts
File metadata and controls
41 lines (38 loc) · 1.04 KB
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
import { defineConfig } from 'vite'
import preact from '@preact/preset-vite'
import daisyUiThemes from 'daisyui/src/theming/themes'
import tsconfigPaths from 'vite-tsconfig-paths'
import checker from 'vite-plugin-checker'
const daisyUiFormattedThemes = Object.entries(daisyUiThemes).map(([k, v]) => ({
theme: k.match(/theme=([-\w]+)/)[1],
scheme: v['color-scheme']
}))
daisyUiFormattedThemes.sort((a, b) =>
`${a.scheme}${a.theme}`.localeCompare(`${b.scheme}${b.theme}`)
)
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
preact(),
tsconfigPaths(),
checker({
typescript: true
})
],
define: {
CARD_VERSION: JSON.stringify(process.env.npm_package_version),
DAISYUI_CDN_URL:
'"https://cdn.jsdelivr.net/npm/daisyui@latest/dist/full.css"',
DAISYUI_THEMES: daisyUiFormattedThemes
},
build: {
rollupOptions: {
input: 'src/main.ts',
output: {
dir: 'dist',
entryFileNames: 'tailwindcss-template-card.js',
manualChunks: undefined
}
}
}
})