Улучшил работу, мелкие фиксы
This commit is contained in:
+14
-7
@@ -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()],
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user