feat: build lightrag webui frontend via bun in shellHook
Adds pkgs.bun to lightrag devShell and builds the React frontend on first shell entry if lightrag/api/webui doesn't exist yet. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
devShells.${system} = {
|
||||
|
||||
lightrag = pkgs.mkShell {
|
||||
packages = [ pkgs.uv pkgs.python312 pkgs.curl ];
|
||||
packages = [ pkgs.uv pkgs.python312 pkgs.curl pkgs.bun ];
|
||||
|
||||
shellHook = ''
|
||||
RAGS_ROOT="$PWD"
|
||||
@@ -59,6 +59,14 @@
|
||||
uv sync --extra api --extra offline-llm --quiet
|
||||
source .venv/bin/activate
|
||||
|
||||
if [ ! -d lightrag/api/webui ]; then
|
||||
echo "Building frontend (first time, ~1min)..."
|
||||
cd lightrag_webui
|
||||
bun install --frozen-lockfile --silent
|
||||
bun run build:bun
|
||||
cd ..
|
||||
fi
|
||||
|
||||
if [ -f "$RAGS_ROOT/.env.lightrag" ]; then
|
||||
set -a; source "$RAGS_ROOT/.env.lightrag"; set +a
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user