2024-07-10 15:57:37 +00:00
|
|
|
import react from '@vitejs/plugin-react'
|
2024-10-15 09:03:35 +00:00
|
|
|
import { defineConfig, loadEnv } from 'vite'
|
2024-09-10 06:37:23 +00:00
|
|
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
2024-07-10 15:57:37 +00:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
2024-10-15 09:03:35 +00:00
|
|
|
export default defineConfig(({ mode }) => {
|
|
|
|
// Load env file based
|
|
|
|
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
|
|
|
|
const env = loadEnv(mode, process.cwd(), '')
|
|
|
|
return {
|
|
|
|
// vite config
|
|
|
|
plugins: [react(), tsconfigPaths()],
|
|
|
|
...(env.VITE_BASE_URL ? { base: env.VITE_BASE_URL } : {})
|
|
|
|
}
|
2024-07-10 15:57:37 +00:00
|
|
|
})
|