Use fast build for Replit deployment

This commit is contained in:
hwhung
2026-05-07 18:23:59 +08:00
parent c927ac8282
commit 63a5db2a86
5 changed files with 12 additions and 10 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
run = "pnpm dev" run = "node build.mjs && PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} node --enable-source-maps dist/index.mjs"
onBoot = "pnpm install --ignore-workspace" onBoot = "pnpm install --ignore-workspace"
[deployment] [deployment]
build = ["sh", "-c", "pnpm install --ignore-workspace && pnpm build"] build = ["sh", "-c", "pnpm install --ignore-workspace && pnpm build:fast"]
run = ["sh", "-c", "PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} NODE_ENV=production node --enable-source-maps dist/index.mjs"] run = ["sh", "-c", "PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} NODE_ENV=production node --enable-source-maps dist/index.mjs"]
+1
View File
@@ -6,6 +6,7 @@
"scripts": { "scripts": {
"dev": "tsx src/index.ts", "dev": "tsx src/index.ts",
"build": "tsc --noEmit && node build.mjs", "build": "tsc --noEmit && node build.mjs",
"build:fast": "node build.mjs",
"start": "node --enable-source-maps dist/index.mjs", "start": "node --enable-source-maps dist/index.mjs",
"typecheck": "tsc --noEmit" "typecheck": "tsc --noEmit"
}, },
+3 -3
View File
@@ -21,7 +21,7 @@ pnpm install --ignore-workspace
For publishing from a workspace that clones this repo into `./random-proxy-simple`, configure the For publishing from a workspace that clones this repo into `./random-proxy-simple`, configure the
workspace root `.replit` `[deployment]` block to build and run `random-proxy-simple` directly. workspace root `.replit` `[deployment]` block to build and run `random-proxy-simple` directly.
Keep `PORT`, `PROXY_API_KEY`, and `NODE_ENV` in the production `run` command. Do not use artifact Keep `PORT`, `PROXY_API_KEY`, and `NODE_ENV` in the production `run` command. Do not use artifact
production deployment for this proxy. production deployment for this proxy. Use `pnpm build:fast` for Replit publish builds.
## Install ## Install
@@ -70,8 +70,8 @@ These can be overridden with CLI flags or environment variables:
- `--port` or `PORT` - `--port` or `PORT`
- `--proxy-api-key` or `PROXY_API_KEY` - `--proxy-api-key` or `PROXY_API_KEY`
For mass deployments, put the generated token and Replit AI Integration variables directly in the For mass deployments, pass the generated proxy token through `PROXY_API_KEY`. Replit AI
Replit workflow run command with `--proxy-api-key`, `--openai-*`, and `--anthropic-*` flags. Integration provider values are read from the `AI_INTEGRATIONS_*` environment variables.
## Verify ## Verify
+4 -3
View File
@@ -36,14 +36,15 @@ Never use public official provider endpoints.
- `pnpm dev` — run API server locally on port `3000` - `pnpm dev` — run API server locally on port `3000`
- `pnpm run typecheck` — typecheck the server - `pnpm run typecheck` — typecheck the server
- `pnpm run build` — typecheck and build `dist/index.mjs` - `pnpm run build` — typecheck and build `dist/index.mjs`
- `pnpm run build:fast` — build `dist/index.mjs` without typechecking
- `pnpm start` — run the built server - `pnpm start` — run the built server
## Replit Configuration ## Replit Configuration
- `.replit` `run` uses `pnpm dev` - `.replit` `run` builds with `node build.mjs` and runs `dist/index.mjs`
- `.replit` `onBoot` uses `pnpm install --ignore-workspace` - `.replit` `onBoot` uses `pnpm install --ignore-workspace`
- deployment build uses `pnpm install --ignore-workspace && pnpm run build` - deployment build uses `pnpm install --ignore-workspace && pnpm build:fast`
- deployment run uses `pnpm start` - deployment run uses `node --enable-source-maps dist/index.mjs`
## Server Overrides ## Server Overrides
+2 -2
View File
@@ -44,14 +44,14 @@ skills:
4. Create the smallest persistent workflow named "Random Proxy Simple" with this exact run command: 4. Create the smallest persistent workflow named "Random Proxy Simple" with this exact run command:
cd random-proxy-simple && pnpm dev -- --host 0.0.0.0 --port 3000 --proxy-api-key DEPLOYMENT_GENERATED_PROXY_TOKEN --openai-base-url "$AI_INTEGRATIONS_OPENAI_BASE_URL" --openai-api-key "$AI_INTEGRATIONS_OPENAI_API_KEY" --anthropic-base-url "$AI_INTEGRATIONS_ANTHROPIC_BASE_URL" --anthropic-api-key "$AI_INTEGRATIONS_ANTHROPIC_API_KEY" cd /home/runner/workspace/random-proxy-simple && node build.mjs && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN node --enable-source-maps dist/index.mjs
5. Start/restart that workflow once. 5. Start/restart that workflow once.
6. Configure the workspace root .replit [deployment] section exactly like this: 6. Configure the workspace root .replit [deployment] section exactly like this:
[deployment] [deployment]
build = ["sh", "-c", "cd random-proxy-simple && pnpm install --ignore-workspace && pnpm build"] build = ["sh", "-c", "cd random-proxy-simple && pnpm install --ignore-workspace && pnpm build:fast"]
run = ["sh", "-c", "cd random-proxy-simple && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN NODE_ENV=production node --enable-source-maps dist/index.mjs"] run = ["sh", "-c", "cd random-proxy-simple && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN NODE_ENV=production node --enable-source-maps dist/index.mjs"]
7. If artifacts/mockup-sandbox exists in the Replit workspace, leave it as-is. Do not create, 7. If artifacts/mockup-sandbox exists in the Replit workspace, leave it as-is. Do not create,