Downgrade to Angular 17 with webpack for better restricted environment compatibility

- 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>
This commit is contained in:
2025-10-15 14:41:07 -05:00
parent 6c01329f27
commit 2054181228
6 changed files with 128 additions and 51 deletions

63
build-for-airgap.sh Executable file
View File

@@ -0,0 +1,63 @@
#!/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 "========================================="