Skip to content

Resources optimizations

ozasadnyy edited this page Oct 9, 2014 · 5 revisions

For now resources optimization scripts works only on Windows

But for Mac OS users available amazing tool - imageoptim. Thanks @raphaelsavina for link.

Images

You can optimize images by running all_image_optimization.bat from \automation\images\ folder

all_image_optimization.bat -d -jtran -pout -pquant -optip -gsicle -svgo

Parameters:

For -svgo intall Nodejs and then run command

[sudo] npm install -g svgo

You can use some of parameters. For example

all_image_optimization.bat -d -jtran -optip

Moreover, you can run the files separately jpegtran.bat, pngout.bat, optipng.bat, pngquant.bat, gifsicle.bat or svgo.bat which by default will optimize all images in /img/ folder and subfolder or pass a path to the folder.

jpegtran.bat 

Or

jpegtran.bat D:\development\web\devfest-14\images

Minify CSS and JS

You can optimize all .css and .js files in /css/ and /js/ folders by running minify_all.bat from \automation\minifying\ folder

minify_all.bat

Specify pathes to .css and .js folders through parameters

minify_all.bat path_to_css_folder path_to_js_folder

For example

minify_all.bat D:\development\web\devfest-14\styles D:\development\web\devfest-14\scripts

Note! path to css folder should be first For sure, you can run the files separately minify_css.bat or minify_js.bat You can use some of them. For example

minify_css.bat 

Or

minify_css.bat D:\development\web\devfest-14\styles

Also you can generate .min files only of main.css and scripts.js

minify_main_css.bat
minify_scripts_js.bat