Улучшил работу, мелкие фиксы

This commit is contained in:
NikitaKalitov
2026-07-20 11:59:47 +03:00
parent 041fca449d
commit da7e022f50
2 changed files with 49 additions and 38 deletions
+14 -7
View File
@@ -1,11 +1,18 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
// Needed when the build is served from a subpath (e.g. local/diagram-app/
// inside the Bitrix docroot) instead of domain root — see
// docs/bitrix-integration.md §7.
base: process.env.VITE_BASE_PATH || '/',
plugins: [react()],
export default defineConfig(({ mode }) => {
// VITE_BASE_PATH is read here (config/Node context), so it needs an explicit
// loadEnv call — unlike VITE_BITRIX_ORIGIN, which Vite injects into
// import.meta.env automatically because it's only read from app code.
const env = loadEnv(mode, process.cwd(), '')
return {
// Needed when the build is served from a subpath (e.g. local/diagram-app/
// inside the Bitrix docroot) instead of domain root — see
// docs/bitrix-integration.md §7.
base: env.VITE_BASE_PATH || '/',
plugins: [react()],
}
})