Fix server build to produce the correct output file for deployment
Update Vite server build configuration to ensure `production.mjs` is generated, resolving a deployment error. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: e5d29f14-f45b-4502-aef7-ca0395bf135c Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/23kpkkM Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
04cf84c4b7
commit
612fc69acf
3 changed files with 9 additions and 8 deletions
6
.replit
6
.replit
|
|
@ -37,7 +37,11 @@ externalPort = 80
|
||||||
localPort = 38557
|
localPort = 38557
|
||||||
externalPort = 3000
|
externalPort = 3000
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 40437
|
||||||
|
externalPort = 3001
|
||||||
|
|
||||||
[deployment]
|
[deployment]
|
||||||
deploymentTarget = "autoscale"
|
deploymentTarget = "autoscale"
|
||||||
run = ["npm", "start"]
|
run = ["node", "dist/server/production.mjs"]
|
||||||
build = ["npm", "run", "build"]
|
build = ["npm", "run", "build"]
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,11 @@ npm start # Start production server
|
||||||
## Recent Changes (December 2, 2025)
|
## Recent Changes (December 2, 2025)
|
||||||
- ✅ Configured Vite to run on port 5000 for Replit compatibility
|
- ✅ Configured Vite to run on port 5000 for Replit compatibility
|
||||||
- ✅ Set up proper host configuration (0.0.0.0) for Replit proxy
|
- ✅ Set up proper host configuration (0.0.0.0) for Replit proxy
|
||||||
|
- ✅ Added `allowedHosts: true` to allow Replit's dynamic proxy hostnames
|
||||||
- ✅ Updated .gitignore to properly exclude environment files
|
- ✅ Updated .gitignore to properly exclude environment files
|
||||||
- ✅ Installed all npm dependencies
|
- ✅ Installed all npm dependencies
|
||||||
- ✅ Configured deployment settings for Replit autoscale
|
- ✅ Configured deployment settings for Replit autoscale
|
||||||
|
- ✅ Fixed server build to output `dist/server/production.mjs` for deployment
|
||||||
- ✅ Verified application runs without errors in Replit environment
|
- ✅ Verified application runs without errors in Replit environment
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,11 @@ import path from "path";
|
||||||
// Server build configuration
|
// Server build configuration
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
lib: {
|
|
||||||
entry: path.resolve(__dirname, "server/node-build.ts"),
|
|
||||||
name: "server",
|
|
||||||
fileName: "production",
|
|
||||||
formats: ["es"],
|
|
||||||
},
|
|
||||||
outDir: "dist/server",
|
outDir: "dist/server",
|
||||||
target: "node22",
|
target: "node22",
|
||||||
ssr: true,
|
ssr: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
|
input: path.resolve(__dirname, "server/node-build.ts"),
|
||||||
external: [
|
external: [
|
||||||
// Node.js built-ins
|
// Node.js built-ins
|
||||||
"fs",
|
"fs",
|
||||||
|
|
@ -35,7 +30,7 @@ export default defineConfig({
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
format: "es",
|
format: "es",
|
||||||
entryFileNames: "[name].mjs",
|
entryFileNames: "production.mjs",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
minify: false, // Keep readable for debugging
|
minify: false, // Keep readable for debugging
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue