-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
28 lines (26 loc) · 734 Bytes
/
Copy pathvite.config.ts
File metadata and controls
28 lines (26 loc) · 734 Bytes
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
import { basename } from 'node:path'
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import { cwd } from 'node:process'
const isGitHubPages = true
const folderName = `${basename(cwd())}/`
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development'
const base = mode === 'production' && isGitHubPages ? `/${folderName}` : '/'
export default defineConfig({
root: 'src',
base,
mode,
envDir: '../',
publicDir: '../public',
plugins: [tailwindcss(), tsconfigPaths()],
resolve: {
alias: {
'~': new URL('./src', import.meta.url).pathname,
},
},
build: {
outDir: '../dist',
assetsDir: './',
},
})