cherry-pick c0b1552e (resolved)
This commit is contained in:
parent
3bba440cfb
commit
922c2e7f7f
2 changed files with 33 additions and 16 deletions
29
.gitignore
vendored
29
.gitignore
vendored
|
|
@ -9,10 +9,9 @@ __pycache__/
|
||||||
|
|
||||||
# Virtual Environment
|
# Virtual Environment
|
||||||
.venv/
|
.venv/
|
||||||
|
env/
|
||||||
venv/
|
venv/
|
||||||
|
*.env*
|
||||||
# Enviroment Variable Files
|
|
||||||
.env
|
|
||||||
|
|
||||||
# Build / Distribution
|
# Build / Distribution
|
||||||
dist/
|
dist/
|
||||||
|
|
@ -46,13 +45,12 @@ neo4jWorkDir/
|
||||||
|
|
||||||
# Data & Storage
|
# Data & Storage
|
||||||
inputs/
|
inputs/
|
||||||
output/
|
|
||||||
rag_storage/
|
rag_storage/
|
||||||
|
examples/input/
|
||||||
|
examples/output/
|
||||||
|
output*/
|
||||||
data/
|
data/
|
||||||
|
|
||||||
# Evaluation results
|
|
||||||
lightrag/evaluation/results/
|
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
.DS_Store
|
.DS_Store
|
||||||
TODO.md
|
TODO.md
|
||||||
|
|
@ -60,17 +58,18 @@ ignore_this.txt
|
||||||
*.ignore.*
|
*.ignore.*
|
||||||
|
|
||||||
# Project-specific files
|
# Project-specific files
|
||||||
/dickens*/
|
dickens*/
|
||||||
/book.txt
|
book.txt
|
||||||
|
LightRAG.pdf
|
||||||
download_models_hf.py
|
download_models_hf.py
|
||||||
|
lightrag-dev/
|
||||||
|
gui/
|
||||||
|
|
||||||
# Frontend build output (built during PyPI release)
|
# Frontend build output (built during PyPI release)
|
||||||
/lightrag/api/webui/
|
lightrag/api/webui/
|
||||||
|
|
||||||
# temporary test files in project root
|
# unit-test files
|
||||||
/test_*
|
test_*
|
||||||
|
|
||||||
# Cline files
|
# Cline files
|
||||||
memory-bank
|
memory-bank/
|
||||||
.claude/CLAUDE.md
|
|
||||||
.claude/
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,30 @@
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import { existsSync, mkdirSync } from 'fs'
|
||||||
import { webuiPrefix } from '@/lib/constants'
|
import { webuiPrefix } from '@/lib/constants'
|
||||||
import react from '@vitejs/plugin-react-swc'
|
import react from '@vitejs/plugin-react-swc'
|
||||||
import tailwindcss from '@tailwindcss/vite'
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
|
|
||||||
|
const ensureWebuiDir = () => ({
|
||||||
|
name: 'ensure-webui-dir',
|
||||||
|
apply: 'build' as const,
|
||||||
|
buildStart() {
|
||||||
|
const outDir = path.resolve(__dirname, '../lightrag/api/webui')
|
||||||
|
if (!existsSync(outDir)) {
|
||||||
|
mkdirSync(outDir, { recursive: true })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeBundle() {
|
||||||
|
const outDir = path.resolve(__dirname, '../lightrag/api/webui')
|
||||||
|
if (!existsSync(outDir)) {
|
||||||
|
mkdirSync(outDir, { recursive: true })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss()],
|
plugins: [react(), tailwindcss(), ensureWebuiDir()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, './src')
|
'@': path.resolve(__dirname, './src')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue