-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
38 lines (29 loc) Β· 943 Bytes
/
Copy pathbuild.sh
File metadata and controls
38 lines (29 loc) Β· 943 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
37
38
#!/bin/bash
# Vercel Build Script for Flutter Web App
echo "π Starting Flutter Web Build for Vercel..."
# Install Flutter if not available
if ! command -v flutter &> /dev/null; then
echo "π¦ Installing Flutter..."
git clone https://github.com/flutter/flutter.git -b stable --depth 1 /tmp/flutter
export PATH="$PATH:/tmp/flutter/bin"
fi
# Verify Flutter installation
flutter --version
# Enable web support
flutter config --enable-web
# Get dependencies
echo "π¦ Getting Flutter dependencies..."
flutter pub get
# Clean previous builds
flutter clean
# Build for web with optimizations
echo "π¨ Building Flutter web app..."
flutter build web \
--release \
--base-href "/" \
--dart-define=FLUTTER_WEB_CANVASKIT_URL=https://unpkg.com/canvaskit-wasm@0.39.1/bin/ \
--source-maps
echo "β
Flutter web build completed!"
echo "π Build output: build/web/"
# List build contents for verification
ls -la build/web/