This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Make shit happen
setup.py install and run squeezeit
/path/to/config.yaml (see below)
Squeezeit is configured through the use of YAML files. There are two types of YAML file needed for squeezeit to run;
Specifies the main configuration options for the bundler, such as source directories and output directories.
Bundle configuration files
These are YAML files in the 'bundles' directory specified above. A bundle config file contains all the media that should be included with a particular bundle. Output bundles will be named the same as the YAML file (so media.yaml will output media.js, media.css etc.)
All bundles will output 6 (or 3) files;
- bundlename.js/css - Combined but not minified files, this is the same as
cat file1.js file2.js >> bundle.js
- bundlename.min.js/css - Combined and minified versions of the files. JS minification is done using JSMin and CSS minification is done using slimmer
- bundlename.min.js/css.gz - Combined, minified and GZipped version of the file.
Bundle info file
The bundler outputs a 'bundle info file' to output-directory/info.yaml. The bundle info file contains information about the sizes of the bundles, and their MD5 has (useful for using MD5 in filenames).
md5: false) so you can detect that from your code.
It wasn't all me
Squeezeit includes two excellent libraries to do it's work (on top of the standard Python ones);
- JSMin.py - By Douglas Crockford and Dave St.Germain
- Slimmer - By Peter Bengtsson
Other cool things to check out;
- PNGCrush - Great at optimising images and stuff