I am just wondering if anyone had any thoughts on reducing the number of files when deploying custom experience builder apps on Azure Static Web Apps? The file limit is currently 15,000 files and roughly each of my experience builder apps takes about ~5000-8000 files depending on the complexity.
I can get 2/3 apps deployed nicely but it would be nice to have a way of deploying more apps on Azure Static Web Apps.
Thanks!
Solved! Go to Solution.
We found the same limitation - with web apps built with ExB 1.13 now creating over 20K files. Our investigation found that ExB adds support for 40 different internationalization (I18n) and translation (T9n) languages - which equates to 14.6K files.
We developed the following PowerShell script to remove non-English I18n and T9n files to reduce the total file count below 15,000 without affecting functionality of the ExB generated web apps.
#
# Script: RemoveUnusedLocales.ps1
# Version: 1.0
# Date: 2023-11-24
# Description: Remove unneeded locale files from an Experience Builder generated web app
#
$folderPath = "."
$locales = @("ar", "bg", "bs", "ca", "cs", "da", "de", "el", "es", "et", "fi", "fr", "he", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "nb", "nl", "pl", "pt-br", "pt-pt", "ro", "ru", "sk", "sl", "sr", "sv", "th", "tr", "zh-cn", "uk", "vi", "zh-hk", "zh-tw")
foreach ($locale in $locales) {
$regexPattern = "(t9n.$locale|i18n.$locale|messages_$locale)\.json$" # Filename pattern of files to remove
$fileList = Get-ChildItem -Path $folderPath -Recurse | Where-Object { $_.Name -match $regexPattern } | Select-Object -ExpandProperty FullName
$fileCount = $fileList.Count
echo "Removing $fileCount locale files that match pattern ""$regexPattern"" ..."
$fileList | Remove-Item -Force
}
We found the same limitation - with web apps built with ExB 1.13 now creating over 20K files. Our investigation found that ExB adds support for 40 different internationalization (I18n) and translation (T9n) languages - which equates to 14.6K files.
We developed the following PowerShell script to remove non-English I18n and T9n files to reduce the total file count below 15,000 without affecting functionality of the ExB generated web apps.
#
# Script: RemoveUnusedLocales.ps1
# Version: 1.0
# Date: 2023-11-24
# Description: Remove unneeded locale files from an Experience Builder generated web app
#
$folderPath = "."
$locales = @("ar", "bg", "bs", "ca", "cs", "da", "de", "el", "es", "et", "fi", "fr", "he", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "nb", "nl", "pl", "pt-br", "pt-pt", "ro", "ru", "sk", "sl", "sr", "sv", "th", "tr", "zh-cn", "uk", "vi", "zh-hk", "zh-tw")
foreach ($locale in $locales) {
$regexPattern = "(t9n.$locale|i18n.$locale|messages_$locale)\.json$" # Filename pattern of files to remove
$fileList = Get-ChildItem -Path $folderPath -Recurse | Where-Object { $_.Name -match $regexPattern } | Select-Object -ExpandProperty FullName
$fileCount = $fileList.Count
echo "Removing $fileCount locale files that match pattern ""$regexPattern"" ..."
$fileList | Remove-Item -Force
}
Thanks for the reply and providing a nice clean up script. It would be nice if esri provided more configuration capabilities in the deploy process.