From a82f3a4cf1a8e9e81fb19ea88ed9487b04590c21 Mon Sep 17 00:00:00 2001 From: LY <51789698+Young-Lord@users.noreply.github.com> Date: Sun, 6 Oct 2024 14:57:03 +0800 Subject: [PATCH] fix vercel build --- frontend/package.json | 2 ++ package.json | 2 +- vercel.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 860f809..521783e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -4,8 +4,10 @@ "private": true, "scripts": { "gen-metadata": "cd .. && cd server && poetry run python wsgi.py --export-metadata ../frontend/src/metadata.json && cd .. && cd frontend", + "vercel-gen-metadata": "cd .. && cd server && python3 -m poetry run python wsgi.py --export-metadata ../frontend/src/metadata.json && cd .. && cd frontend", "dev": "yarn run gen-metadata && vite", "build": "yarn run gen-metadata && vite build --emptyOutDir", + "vercel-build": "yarn run vercel-gen-metadata && vite build --emptyOutDir", "preview": "vite preview", "lint": "eslint . --fix" }, diff --git a/package.json b/package.json index 63fd838..c3308b4 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,6 @@ "name": "online-clipboard-vercel-build", "private": true, "scripts": { - "build": "mkdir -p dist && cd server && pip3 install poetry-plugin-export poetry && python3 -m poetry add psycopg2-binary^2.9.9 && python3 -m poetry export -f requirements.txt --output requirements.txt && pip3 uninstall -y poetry-plugin-export poetry && mv requirements.txt .. && cd .. && mkdir -p dist && cd frontend && yarn install && yarn build && cd .. && rm -rf frontend && cp -r server/app/templates/* dist" + "build": "mkdir -p dist && cd server && pip3 install poetry-plugin-export poetry && python3 -m poetry add psycopg2-binary^2.9.9 flask-restx-vercel && python3 -m poetry export -f requirements.txt --output requirements.txt && mv requirements.txt .. && cd .. && mkdir -p dist && cd frontend && yarn install && yarn vercel-build && cd .. && rm -rf frontend && cp -r server/app/templates/* dist && pip3 uninstall -y poetry-plugin-export poetry" } } \ No newline at end of file diff --git a/vercel.json b/vercel.json index 3393e5f..c035d01 100644 --- a/vercel.json +++ b/vercel.json @@ -25,4 +25,4 @@ "env": { "PYTHONPATH": "server/" } -} \ No newline at end of file +}