23 lines
738 B
JavaScript
23 lines
738 B
JavaScript
import {defineConfig, loadEnv} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
export default defineConfig(async ({mode}) => {
|
|
const env = loadEnv(mode, process.cwd(), '')
|
|
console.log('🚀 Running Vite in mode:', mode)
|
|
|
|
return {
|
|
plugins: [
|
|
vue(),
|
|
// пример: включаем devtools только в development/staging
|
|
env.VITE_ENABLE_DEVTOOLS === 'true'
|
|
? (await import('vite-plugin-vue-devtools')).default()
|
|
: undefined
|
|
].filter(Boolean),
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
}
|
|
}) |