forked from solidcouch/solidcouch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
36 lines (34 loc) · 1 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
import react from '@vitejs/plugin-react-swc'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { ConfigEnv, defineConfig } from 'vite'
import checker from 'vite-plugin-checker'
import { fetchCommunityEnv } from './plugins/fetchCommunityEnv'
import { postbuild } from './plugins/postbuild'
import { serveClientId } from './plugins/serveClientId'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// https://vite.dev/config/
// eslint-disable-next-line import/no-default-export
export default defineConfig((config: ConfigEnv) => {
return {
plugins: [
fetchCommunityEnv(config),
react(),
checker({
typescript: { buildMode: true },
eslint: { lintCommand: 'eslint .', useFlatConfig: true },
}),
serveClientId(config),
postbuild(config),
],
define: {
'process.env': process.env,
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
}
})