forked from dangduyminh109/algorithm-design-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·36 lines (28 loc) · 775 Bytes
/
build.sh
File metadata and controls
executable file
·36 lines (28 loc) · 775 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
31
32
33
34
35
36
#!/bin/bash
echo "Starting optimized build process..."
# Clean previous builds
echo "Cleaning previous builds..."
rm -rf .next out node_modules/.cache
# Install dependencies with cache optimization
echo "Installing dependencies..."
npm ci --prefer-offline --no-audit
# Check for TypeScript errors
echo "Checking TypeScript..."
npx tsc --noEmit
# Lint code
echo "Linting code..."
npm run lint
# Build with optimizations
echo "Building with optimizations..."
NODE_ENV=production npm run build
# Analyze bundle size
echo "Analyzing bundle size..."
if [ -d ".next" ]; then
echo "Build completed successfully!"
echo "Checking bundle size..."
du -sh .next/static/chunks/*.js | head -10
else
echo "Build failed!"
exit 1
fi
echo "✨ Build optimization completed!"