-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
30 lines (24 loc) · 911 Bytes
/
build.sh
File metadata and controls
30 lines (24 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Build the application for production
echo "Building application for production..."
# First build the frontend with vite
echo "Building frontend assets..."
npx vite build
# Build the backend with esbuild
echo "Building backend..."
# This ensures all Vite-related packages are marked as external, so they aren't bundled
npx esbuild server/**/*.ts --platform=node --packages=external --external:vite --external:@vitejs/plugin-react --external:@replit/* --bundle --format=esm --outdir=dist
# Check if build was successful
if [ $? -eq 0 ]; then
echo "✓ Build completed successfully!"
# Show the build directory structure
echo -e "\nBuild directory structure:"
ls -la dist/
echo -e "\nFrontend assets:"
ls -la dist/public/
echo -e "\nBuild completed successfully. You can now run:"
echo " docker-compose build"
echo " docker-compose up"
else
echo "❌ Build failed!"
fi