Skip to content

Commit 7be12a0

Browse files
fix: disable aggressive file optimization that was corrupting JS bundles
The workflow was splitting/deleting large JS files (>200KB) which was truncating the main application bundle (1.5MB) to only 10KB, causing syntax errors on the live site. Changes: - Disabled vendor chunk splitting - Disabled large file removal - Disabled sed-based comment removal on minified JS - Preserved complete file integrity for deployment
1 parent 9951396 commit 7be12a0

1 file changed

Lines changed: 7 additions & 30 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -165,38 +165,15 @@ jobs:
165165
find dist/ -name "*.map" -delete
166166
echo "✅ Removed source maps"
167167
168-
# More aggressive optimization for large files
169-
echo "🔧 Applying aggressive optimizations for GitHub Pages..."
168+
# DISABLED: Don't split files as it breaks module loading
169+
echo "🔧 Skipping aggressive optimizations (preserving file integrity)"
170170
171-
# Remove large vendor chunks and split them
172-
find dist/ -name "*vendor*.js" -size +300k -exec sh -c '
173-
file="$1"
174-
size=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null || echo 0)
175-
if [ $size -gt 300000 ]; then
176-
echo "Splitting large vendor file: $file ($size bytes)"
177-
# Split large files into smaller chunks
178-
split -b 200k "$file" "${file%.js}_chunk_"
179-
rm "$file"
180-
fi
181-
' _ {} \;
182-
echo "✅ Split large vendor chunks"
183-
184-
# Remove non-essential large files
185-
find dist/ -name "*.js" -size +200k -not -name "index.*" -exec sh -c '
186-
file="$1"
187-
if [[ "$file" == *"three"* ]] || [[ "$file" == *"ai"* ]]; then
188-
echo "Keeping essential large file: $file"
189-
else
190-
echo "Removing non-essential large file: $file"
191-
rm "$file"
192-
fi
193-
' _ {} \;
194-
echo "✅ Removed non-essential large files"
171+
# DISABLED: Don't remove large files as it breaks the app
172+
# The main bundle needs to be preserved intact
173+
echo "✅ Skipping large file removal (preserving main bundle)"
195174
196-
# Optimize remaining JS files by removing comments and whitespace
197-
find dist/ -name "*.js" -size +100k -exec sed -i '/^[[:space:]]*\/\//d' {} \;
198-
find dist/ -name "*.js" -size +100k -exec sed -i '/^[[:space:]]*\/\*/,/\*\//d' {} \;
199-
echo "✅ Optimized remaining JS files"
175+
# DISABLED: Don't use sed on minified JS as it can corrupt the code
176+
echo "✅ Skipping JS comment removal (files already minified)"
200177
201178
# Remove any temporary or cache files
202179
find dist/ -name "*.tmp" -o -name "*.cache" -o -name "*.log" -delete

0 commit comments

Comments
 (0)