the javascript directory of SpiderBasic contains a lot of JS- and CSS-files. I checked the loading time of the 2ddrawing-example via GTmetrix (http://gtmetrix.com) and in the result table are the suggestion to compress the JS- and CSS-files to reduce the loading time. I look for a JS/CSS-compressor for the Windows environment and I found Microsofts Ajax Minifier (http://ajaxmin.codeplex.com). AjaxMin is a command line tool. To feed AjaxMin I code a PowerShell script and this creates a batch file.
Code: Select all
#-Begin-----------------------------------------------------------------
$Content = ""
#-Get all JavaScript files--------------------------------------------
$Files = Get-ChildItem . -Filter "*.js" -Recurse
$Files | ForEach-Object {
$Line = "AjaxMinifier.exe -JS """ + $_.FullName + """ -out """ +
$_.FullName + """"
$Content += $Line + "`r`n"
}
#-Get all Cascading Style Sheet files---------------------------------
$Files = Get-ChildItem . -Filter "*.css" -Recurse
$Files | ForEach-Object {
$Line = "AjaxMinifier.exe -CSS """ + $_.FullName + """ -out """ +
$_.FullName + """"
$Content += $Line + "`r`n"
}
#-Write the batch file------------------------------------------------
New-Item . -Name Min.bat -Type "File" -Value $Content -Force
#-Delete all LICENSE and README.md files------------------------------
$Files = Get-ChildItem . -Include "LICENSE", "README.md" -Recurse
$Files | ForEach-Object {
Remove-Item $_.FullName
}
#-End-------------------------------------------------------------------
Enjoy it.
Cheers
Stefan