Minify and combine CSS stylesheets (using @imports) or Javascripts (using a proxy JSON script) into a single sheet or script.
If you do not want to use this simple frontend you also may use the Minifier as a simple webservice (big word...).
Any @import in the given CSS stylesheet is resolved and
results in a single stylesheet.
Simply send the URL of the CSS to be combined and minified to:
http://minifier.appspot.com/cssmin?url=
As Javascript in contrast to CSS has no built in import facility a
simple JSON proxy script which lists the to be imported scripts is used.
Please mind the exact
JSON syntax (no comments, only double quotes etc.).
Example:
{ "imports": ["1.js", "2.js"] }
The list contains relative (to the proxy) paths of the scripts to be combined
and minified.
Send the URL of a JSON proxy script to be combined and minified to:
http://minifier.appspot.com/jsmin?url=
url
(mandatory)
errorlevel = INFO | WARNING [default] | ERROR | FATAL
400 BAD REQUEST
with information about parsing problems will be
given. When setting
errorlevel
messages below will be ignored.
flat = true [default] | false
@import
rules will be resolved. If the referenced sheet cannot be read
the rule will be kept as is.
vars = true [default] | false
@variables
rules will be removed and any
var() values are
resolved.
encoding
UTF-8
and
ASCII
(being an UTF-8
subset) do work.
http://minifier.appspot.com/cssmin?url=http://minifier.appspot.com/static/css.css
http://minifier.appspot.com/jsmin?url=http://minifier.appspot.com/static/test/jsonproxy.js
The response contains the minified CSS or script (send with UTF-8 encoding). The
CSS depending on the
encoding
parameter might actually be serialized as ASCII so e.g. a german umlaut
ä
will be serialized as
/E4.
In case of any error a
400 BAD REQUEST
is returned and the response contains the error. This might for example be if the URL given
returns no valid CSS or no CSS at all or no valid JSON or any of the references scripts are not
readable.
Currently the CSS must be valid!
A
500 INTERNAL SERVER ERROR
might also happen.
The CSS Minifier tries to read the CSS from given URL
and minifies it.
@import
rules may optionally be resolved resulting in a
single stylesheet.
A target encoding for the resulting stylesheet may be given but currently only UTF-8 or ASCII encoded CSS are working properly.
The Javascript minifier combines Javascripts using a custom defined proxy JSON script and uses jsmin to minify the result.