Skip to main content

collective.recipe.minify

Detailed Documentation

Supported options

The recipe supports the following options:

css-command

The script to be used for css minification. The YUI compressor is a good choice here. This option is not required. If it is omitted, a very simple whitespace stripping is done [’ ‘.join(RESOURCE.split())]. The command must write its result to the standard output.

js-command

Same as css-command but used for JavaScript resources.

ignore

A list of fnmatch-patters. If a filename matches one of these expressions, it is omitted from the minifying process.

paths

A list of paths, which contains JavaScript and CSS resources. All files ending with ‘.js’ and ‘.css’ are considered, except those which are ignored explicitly (see ignore option).

suffix

Filename suffix that is used for the copy of the original file. The default is -full. If the orignal filename is style.css the minified version will be style.css and the original development version will be style-full.css.

include-devel

Include all packages listed in the devel-section of the buildout. This option is turned OFF per default.

verbose

Set verbosity for minify runs. The allowed values are true and false and the default is false.

Example usage

A simple buildout that uses the recipe looks like this:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = minify
...
... [minify]
... recipe = collective.recipe.minify
... paths =
...    ${buildout:directory}/src/foo
... ignore =
...      firm*
... include-devel = false
... """)

Running the buildout gives us:

>>> print system(buildout)
Installing minify.
Generated script '/sample-buildout/bin/minify'.
<BLANKLINE>

Running this script minifies all JavaScript and CSS resources found in the specfied locations. It walks all the paths specified ignoring all files matching one of the patterns specified in ignore.

Contributors

Tom Gross, Author

Change history

1.0 (2010-01-05)

  • initial release [Tom Gross]

Download

Release files for collective.recipe.minify 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.recipe.minify 1.0
File Size Uploaded
collective.recipe.minify-1.0.tar.gz 7.9 kB Details

Release files / collective.recipe.minify-1.0.tar.gz

Download URL collective.recipe.minify-1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ed9b9d1020a2098ff9d5311b06e65c1432e34aad3c33d67c80ec1d0574f31c8d
BLAKE2b-256 checksum
How to use checksums
d7ab7332426f78c580c04e42f9928da333e7de22b249c4256696efc390e3a722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page