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
48 lines
1 KiB
TypeScript
48 lines
1 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import path from "path";
|
|
|
|
// Server build configuration
|
|
export default defineConfig({
|
|
build: {
|
|
outDir: "dist/server",
|
|
target: "node22",
|
|
ssr: true,
|
|
rollupOptions: {
|
|
input: path.resolve(__dirname, "server/node-build.ts"),
|
|
external: [
|
|
// Node.js built-ins
|
|
"fs",
|
|
"path",
|
|
"url",
|
|
"http",
|
|
"https",
|
|
"os",
|
|
"crypto",
|
|
"stream",
|
|
"util",
|
|
"events",
|
|
"buffer",
|
|
"querystring",
|
|
"child_process",
|
|
// External dependencies that should not be bundled
|
|
"express",
|
|
"cors",
|
|
],
|
|
output: {
|
|
format: "es",
|
|
entryFileNames: "production.mjs",
|
|
},
|
|
},
|
|
minify: false, // Keep readable for debugging
|
|
sourcemap: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./client"),
|
|
"@shared": path.resolve(__dirname, "./shared"),
|
|
},
|
|
},
|
|
define: {
|
|
"process.env.NODE_ENV": '"production"',
|
|
},
|
|
});
|