- Downgrade from Angular 19 to Angular 17.3.0 - Switch from Vite-based build (@angular/build) to webpack (@angular-devkit/build-angular) - Eliminates Vite, esbuild, and rollup dependencies that were causing issues in restricted npm environments - Update tsconfig.json for webpack compatibility (moduleResolution: bundler) - Update angular.json to use browser builder instead of application builder - Update docker-compose.yml to use prebuilt Dockerfile for air-gapped deployment - Add build-for-airgap.sh helper script for local builds - Update DEPLOYMENT.md with Angular 17 webpack strategy notes - Bundle size: 329.73 kB raw / 86.54 kB gzipped This change improves compatibility with enterprise environments that have restricted package registry access. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
64 lines
1.5 KiB
Bash
Executable File
64 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "========================================="
|
|
echo "Building Angular for Air-Gapped Deployment"
|
|
echo "========================================="
|
|
echo ""
|
|
|
|
# Check if we're in the right directory
|
|
if [ ! -f "docker-compose.yml" ]; then
|
|
echo "Error: Must run from project root directory"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if node is installed
|
|
if ! command -v node &> /dev/null; then
|
|
echo "Error: Node.js is not installed. Please install Node.js 18+ first."
|
|
exit 1
|
|
fi
|
|
|
|
# Check if npm is installed
|
|
if ! command -v npm &> /dev/null; then
|
|
echo "Error: npm is not installed. Please install npm first."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Step 1/3: Installing dependencies..."
|
|
cd frontend
|
|
npm install
|
|
|
|
echo ""
|
|
echo "Step 2/3: Building Angular production bundle..."
|
|
npm run build:prod
|
|
|
|
echo ""
|
|
echo "Step 3/3: Verifying build output..."
|
|
if [ -d "dist/frontend/browser" ]; then
|
|
echo "✓ Build successful!"
|
|
echo "✓ Output: frontend/dist/frontend/browser"
|
|
ls -lh dist/frontend/browser | head -5
|
|
else
|
|
echo "✗ Build failed - output directory not found"
|
|
exit 1
|
|
fi
|
|
|
|
cd ..
|
|
|
|
echo ""
|
|
echo "========================================="
|
|
echo "Build Complete!"
|
|
echo "========================================="
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo "1. Update docker-compose.yml:"
|
|
echo " Change: dockerfile: Dockerfile.frontend"
|
|
echo " To: dockerfile: Dockerfile.frontend.prebuilt"
|
|
echo ""
|
|
echo "2. Deploy:"
|
|
echo " docker-compose up -d --build"
|
|
echo ""
|
|
echo "See DEPLOYMENT.md for more details."
|
|
echo "========================================="
|