Skip to content

Instantly share code, notes, and snippets.

@tegansnyder
Created August 31, 2013 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tegansnyder/6399902 to your computer and use it in GitHub Desktop.
Save tegansnyder/6399902 to your computer and use it in GitHub Desktop.
Example of a simple Magento build script using YUICompressor 2.4.7 and UgilifyJS2. This is just a rough example.
echo "* * * * * * * * * * * * * * * * * * * * *"
echo " Build Script v0.1"
echo " by Tegan Snyder"
echo "* * * * * * * * * * * * * * * * * * * * *"
echo ""
echo "combining css to mysite.css"
cat /store/skin/frontend/mytheme/theme/css/styles.css /store/skin/frontend/base/default/css/widgets.css /store/skin/frontend/mytheme/theme/css/skin.css /store/assets/css/jquery.modal.min.css > /store/css/mysite.css
echo "minifying combining css to mysite.min.css"
java -jar /build/yuicompressor-2.4.7.jar /store/css/mysite.css -o /store/css/mysite.min.css
echo "combining magento js to scriptaculous-varien-magento.js"
cat /store/js/scriptaculous/builder.js /store/js/scriptaculous/effects.js /store/js/scriptaculous/dragdrop.js /store/js/scriptaculous/controls.js /store/js/scriptaculous/slider.js /store/js/varien/js.js /store/js/varien/form.js /store/js/mage/translate.js /store/js/mage/cookies.js | uglifyjs -o /store/js/scriptaculous-varien-magento.js
#echo "minifying any other random js files"
echo 'minifying prototype files'
java -jar /build/yuicompressor-2.4.7.jar /store/js/prototype/prototype.js -o /store/js/prototype/prototype.min.js
java -jar /build/yuicompressor-2.4.7.jar /store/js/prototype/validation.js -o /store/js/prototype/validation.min.js
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment